Better asserts/checks around bad function addresses.

This commit is contained in:
Ben Vanik
2013-05-26 03:26:49 -07:00
parent bf9e92c027
commit 22f186d713
4 changed files with 11 additions and 1 deletions

View File

@@ -36,6 +36,8 @@ void* _cdecl XeIndirectBranch(
// TODO(benvanik): track this statistic - this path is very slow!
Processor* processor = (Processor*)state->processor;
void* target_ptr = processor->GetFunctionPointer((uint32_t)target);
// target_ptr will be null when the given target is not a function.
XEASSERTNOTNULL(target_ptr);
return target_ptr;
}