Misc cleanups in the trap handling code.

This commit is contained in:
Dan Gohman
2018-12-13 12:09:04 -08:00
parent 26eb8131da
commit 717f60bda1
4 changed files with 48 additions and 59 deletions

View File

@@ -406,13 +406,7 @@ HandleTrap(CONTEXT* context)
{
assert(sAlreadyHandlingTrap);
const uint8_t* pc = ContextToPC(context);
const CodeSegment* codeSegment = LookupCodeSegment(pc);
if (!codeSegment) {
return false;
}
RecordTrap(pc, codeSegment);
RecordTrap(ContextToPC(context));
// Unwind calls longjmp, so it doesn't run the automatic
// sAlreadhHanldingTrap cleanups, so reset it manually before doing