kernel/x86/arch_int: Move cast after NULL check.

Spotted by Lioncash (via IRC). No functional change intended.
This commit is contained in:
Augustin Cavalier 2017-02-25 15:27:25 -05:00
parent 7c6caa8939
commit 0414166a29

View File

@ -295,8 +295,9 @@ x86_page_fault_exception(struct iframe* frame)
// TODO: Now we are generally allowing user_memcpy() with interrupts
// disabled, which in most cases is a bug. We should add some thread
// flag allowing to explicitly indicate that this handling is desired.
uintptr_t handler = reinterpret_cast<uintptr_t>(thread->fault_handler);
if (thread && thread->fault_handler != 0) {
uintptr_t handler =
reinterpret_cast<uintptr_t>(thread->fault_handler);
if (frame->ip != handler) {
frame->ip = handler;
return;