diff --git a/src/manager.cc b/src/manager.cc index 7c63294..035a116 100644 --- a/src/manager.cc +++ b/src/manager.cc @@ -717,20 +717,22 @@ void* Manager::fellthrough_branch(void *id, void *ret_addr) { } } - if(head->is_traced) { + if(head->tracer) { // there is a fallthrough without a backwards branch which means that we never // got to the backwards branch portion of this loop - assert(!head->is_compiled); - assert(head->tracer); + // assert(!head->is_compiled); + // assert(head->tracer); if(head->frame_id == branchable_frame_id) { return head->tracer->CheckNotSelfFellthrough(); } else { // if this is at a different level in the branchable frame then it can't possible be the same instance // and the check self will only check the id not the branchable depth - return head->tracer->DeleteLastCall(); + return head->tracer->DeleteLastCall((void*)&redmagic_fellthrough_branch); } } + assert(!head->is_compiled || head->frame_id != branchable_frame_id); + return NULL; } diff --git a/src/tracer.cc b/src/tracer.cc index 8130c0c..a6f6adf 100644 --- a/src/tracer.cc +++ b/src/tracer.cc @@ -928,8 +928,12 @@ mem_loc_t Tracer::merge_close_core() { assert(0); } +namespace { void _nonamef() {} } -void* Tracer::DeleteLastCall() { +void* Tracer::DeleteLastCall(void *method) { + if((mem_loc_t)method != current_not_traced_call_addr) + return NULL; // this is some other method so just ignore this action + assert((current_not_traced_call_addr & ~0xffffffffL) == (((mem_loc_t)&_nonamef) & ~0xffffffffL)); assert(icount - last_call_instruction < 2); buffer->setOffset(last_call_generated_op); mem_loc_t ret = buffer->getRawBuffer() + buffer->getOffset(); diff --git a/src/tracer.h b/src/tracer.h index b27fd61..7d571ad 100644 --- a/src/tracer.h +++ b/src/tracer.h @@ -59,7 +59,7 @@ namespace redmagic { // end the current merge block void* EndMergeBlock(); - void* DeleteLastCall(); + void* DeleteLastCall(void *method); void set_merge_target(mem_loc_t target) { assert(merge_resume == 0);