Commit fa477fd
committed
Fix interpreter: glob assignment lvalue, DEREF error propagation, each/chop
- CompileAssignment: handle '*' as glob lvalue (e.g. 'foo'->** = 'bar'->**)
Fixes: op/postfixderef.t tests 27-29 (glob access syntax)
- BytecodeInterpreter DEREF: always call scalarDeref() so non-reference types
(IO, FORMAT, etc.) correctly throw 'Not a SCALAR reference'
Fixes: op/postfixderef.t tests 59, 63
- CompileOperator each: force LIST context on operand so %h remains a
RuntimeHash instead of being converted to ARRAY_SIZE via scalar context
Fixes: op/lex_assign.t test 86 (each %h inside scalar assignment)
- OpcodeHandlerExtended.executeChop: use polymorphic .chop() instead of
hard-casting to RuntimeScalar
- MiscOpcodeHandler: handle EACH before RuntimeList cast since EACH now
receives the container (RuntimeHash/RuntimeArray) directly1 parent 3b55221 commit fa477fd
2 files changed
Lines changed: 20 additions & 9 deletions
File tree
- src/main/java/org/perlonjava/backend/bytecode
Lines changed: 4 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1405 | 1405 | | |
1406 | 1406 | | |
1407 | 1407 | | |
1408 | | - | |
1409 | | - | |
1410 | | - | |
1411 | | - | |
1412 | | - | |
1413 | | - | |
1414 | | - | |
1415 | | - | |
1416 | | - | |
| 1408 | + | |
| 1409 | + | |
| 1410 | + | |
| 1411 | + | |
1417 | 1412 | | |
1418 | 1413 | | |
1419 | 1414 | | |
| |||
Lines changed: 16 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
991 | 991 | | |
992 | 992 | | |
993 | 993 | | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
994 | 1010 | | |
995 | 1011 | | |
996 | 1012 | | |
| |||
0 commit comments