new handling of setjmp; now pass return address
This commit is contained in:
parent
083d520d38
commit
ae50580eff
|
@ -670,6 +670,7 @@ eval.o: nofloat.h
|
|||
eval.o: nopp.h
|
||||
eval.o: sizes.h
|
||||
eval.o: spec_arith.h
|
||||
eval.o: specials.h
|
||||
eval.o: stack.h
|
||||
eval.o: target_sizes.h
|
||||
eval.o: type.h
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
#include "align.h"
|
||||
#include "mes.h"
|
||||
#include "atw.h"
|
||||
#include "specials.h"
|
||||
|
||||
#define CRASH() crash("EVAL: CRASH at line %u", __LINE__)
|
||||
#define toword(n) ((n) < word_size ? word_size : (n))
|
||||
|
@ -445,7 +446,20 @@ EVAL(expr, val, code, true_label, false_label)
|
|||
{
|
||||
register struct expr *ex;
|
||||
arith ParSize = (arith)0;
|
||||
label setjmp_label = 0;
|
||||
|
||||
if (left->ex_class == Value && left->VL_CLASS == Name) {
|
||||
if (left->VL_IDF->id_special == SP_SETJMP) {
|
||||
label addr_label = data_label();
|
||||
|
||||
setjmp_label = text_label();
|
||||
C_df_dlb(addr_label);
|
||||
C_rom_ilb(setjmp_label);
|
||||
C_lae_dlb(addr_label, (arith) 0);
|
||||
C_loi(pointer_size);
|
||||
ParSize += pointer_size;
|
||||
}
|
||||
}
|
||||
if ((ex = right) != NILEXPR) {
|
||||
/* function call with parameters*/
|
||||
while ( ex->ex_class == Oper &&
|
||||
|
@ -464,6 +478,9 @@ EVAL(expr, val, code, true_label, false_label)
|
|||
if (left->ex_class == Value && left->VL_CLASS == Name) {
|
||||
/* e.g., main() { (*((int (*)())0))(); } */
|
||||
C_cal(left->VL_IDF->id_text);
|
||||
if (setjmp_label) {
|
||||
C_df_ilb(setjmp_label);
|
||||
}
|
||||
#ifdef DATAFLOW
|
||||
{ extern char options[];
|
||||
if (options['d'])
|
||||
|
|
Loading…
Reference in a new issue