mirror of
https://github.com/ProdigyReloaded/tbol-toolchain.git
synced 2026-11-28 14:38:11 -08:00
operand_int_val used atoi, so an empty-string comparison operand ('')
mapped to 0 and resolved to RET_OK (DEFINEd '0') -- both semantically
wrong and non-round-tripping ('' is 0 bytes, '0' is 1), shifting every
later offset (seen in QAPLTEXT 6.03.17). Only treat a string as a return
code when it round-trips through atoi (canonical decimal), so '' and '00'
no longer collide with '0'; real codes still resolve ('0'->RET_OK,
'10'->RET_SOME_ONES).
Adds decompiler_return_code_names (round-trip + resolution assertions)
over a new control fixture ret_codes.src.
19 lines
377 B
Plaintext
19 lines
377 B
Plaintext
{ Program 'RETCODES' compiled with TBOL COMPILER version 04.21 }
|
|
{ Date Program compiled 08/13/26 13:27 }
|
|
{ Original file ret_codes.cod }
|
|
{ md5sum f87ab8135aa13916c7f61342e731b542 }
|
|
|
|
PROGRAM RETCODES;
|
|
|
|
PROC main =
|
|
CJNE #1, '', label_9;
|
|
RETURN;
|
|
label_9:
|
|
CJNE #1, '0', label_19;
|
|
RETURN;
|
|
label_19:
|
|
CJNE #1, '10', label_30;
|
|
RETURN;
|
|
label_30:
|
|
END_PROC
|