Kernel: cast between inheritance with static_cast
using reinterpret_cast is not a good idea. preferably we would use dynamic_cast, but that is not possible since kernel is compiled with -fno-rtti.
This commit is contained in:
@@ -41,7 +41,7 @@ namespace Kernel
|
||||
|
||||
auto inode = inode_or_error.release_value();
|
||||
if (inode->mode().iflnk())
|
||||
MUST(reinterpret_cast<TmpSymlinkInode*>(inode.ptr())->set_link_target(name()));
|
||||
MUST(static_cast<TmpSymlinkInode&>(*inode.ptr()).set_link_target(name()));
|
||||
}
|
||||
|
||||
BAN::ErrorOr<void> TTY::tty_ctrl(int command, int flags)
|
||||
|
||||
Reference in New Issue
Block a user