Re: SWITCH question
- Posted by irv Jan 06, 2018
- 1818 views
The problem is definitely in the thread() function: Running with the added printf lines shown below (starting around line 2022 of be_execute.c:
// threaded code if (Executing == FALSE) { // TODO XXX might this affect exit code improperly? Cleanup(1); return; } printf("E1a\n"); thread(); printf("E1b\n"); switch((intptr_t)pc) {
I get
E1a -- note: this is during first phase (parsing?) 1 -- printed as expected 1 -- ditto E1a -- second parsing (while in switch loop?) /home/irv/t1.ex:9 A machine-level exception occurred during execution of this statement (signal 11)
Notice it goes thru E1a twice. Trying different ways to declare "op" in my test code:
constant op = stack:new(FIFO) -- hits E1a twice, crashing on second encounter. constant op = cos(0) -- hits E1a only once, prior to printing the 1's, then crashes constant op = 1 -- hits E1a only once, prior to printing the 1's, and runs correctly
BTW: adding the -DINT_CODES gave me a world of errors: