Changeset 466
- Timestamp:
- 02/07/16 20:49:30 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/vm/framscript.y
r382 r466 155 155 { 156 156 int offset; 157 if (trctx.functionstackpos== 999)157 if (trctx.functionstackpos==TranslatorContext::NOT_IN_FUNCTION) 158 158 offset=-trstack.currentPos(); 159 159 else … … 186 186 { 187 187 int offset; 188 if (trctx.functionstackpos== 999)188 if (trctx.functionstackpos==TranslatorContext::NOT_IN_FUNCTION) 189 189 offset=-trstack.currentPos(); 190 190 else … … 231 231 int pos=trstack.currentPos(); 232 232 $$.setInt(pos); 233 if (trctx.functionstackpos!= 999)233 if (trctx.functionstackpos!=TranslatorContext::NOT_IN_FUNCTION) 234 234 {trctx.err->printf("functions cannot be nested\n");return 1;} 235 trctx.beforefunctionstackpos=trstack.currentPos(); 235 236 } 236 237 '(' paramlist ')' … … 242 243 int pos=$3.getInt(); 243 244 trstack.dropToPos(pos); 244 trctx.functionstackpos=999; 245 trctx.functionstackpos=TranslatorContext::NOT_IN_FUNCTION; 246 trctx.beforefunctionstackpos=TranslatorContext::NOT_IN_FUNCTION; 245 247 trctx.out->printf(":_skipfun_%d\n",trctx.functiontmplabel); 246 248 trctx.functiontmplabel=-1; … … 1455 1457 loc=trstack.getVariableLocation(var.getString()); 1456 1458 if (loc != TranslatorStack::NOTFOUND) 1457 {tok.setInt(loc); tok.constant=0; 1458 return 1;} 1459 { 1460 if ((trctx.functionstackpos!=TranslatorContext::NOT_IN_FUNCTION) 1461 && (loc>=trctx.beforefunctionstackpos)) 1462 return 0; 1463 tok.setInt(loc); tok.constant=0; 1464 return 1; 1465 } 1459 1466 return 0; 1460 1467 }
Note: See TracChangeset
for help on using the changeset viewer.