#include "global.h"
#include "costs.h"
-#include <pub_tool_threadstate.h>
+#include "pub_tool_threadstate.h"
/*------------------------------------------------------------*/
/*--- BBCC operations ---*/
/* change source for delayed push */
CLG_(current_state).bbcc = top_ce->jcc->from;
sp = top_ce->sp;
+ passed = top_ce->jcc->jmp;
CLG_(pop_call_stack)();
}
else {
}
}
else {
- CLG_(unwind_call_stack)(sp, 0);
+ Int unwind_count = CLG_(unwind_call_stack)(sp, 0);
+ if (unwind_count > 0) {
+ /* if unwinding was done, this actually is a return */
+ jmpkind = Ijk_Ret;
+ }
if (jmpkind == Ijk_Call) {
delayed_push = True;
if (!skip && CLG_(current_state).nonskipped) {
/* a call from skipped to nonskipped */
CLG_(current_state).bbcc = CLG_(current_state).nonskipped;
+ /* FIXME: take the real passed count from shadow stack */
+ passed = CLG_(current_state).bbcc->bb->cjmp_count;
}
CLG_(push_call_stack)(CLG_(current_state).bbcc, passed,
bbcc, sp, skip);