Re: issue-#126 Compiler TRAP for SYSTEM.VAL(LONGINT, intreg)
Posted: Fri Sep 02, 2016 4:25 am
Since some may still not be convinced that the error handling strategy of my fix is in line with the
rest of the back-end, I have looked it up again and I think it can be improved indeed.
So I have turned the added RETURN in Convert into an ELSE now.
I have chosen the RETURN originally to make it easier for you to see the small difference the fix introduces.
Replacing the RETURN by an ELSE, however, is more in line with the rest of the back-end.
See the diff at http://redmine.blackboxframework.org/pr ... 85b154fba4.
For comparison, have a look at TypTest or ShortTypTest, for example:
- Josef
rest of the back-end, I have looked it up again and I think it can be improved indeed.
So I have turned the added RETURN in Convert into an ELSE now.
I have chosen the RETURN originally to make it easier for you to see the small difference the fix introduces.
Replacing the RETURN by an ELSE, however, is more in line with the rest of the back-end.
See the diff at http://redmine.blackboxframework.org/pr ... 85b154fba4.
For comparison, have a look at TypTest or ShortTypTest, for example:
Code: Select all
PROCEDURE ShortTypTest* (VAR x: DevCPL486.Item; testtyp: DevCPT.Struct);
VAR tag, tdes: DevCPL486.Item;
BEGIN
(* tag must be in AX ! *)
IF testtyp.form = Pointer THEN testtyp := testtyp.BaseTyp END;
IF testtyp.untagged THEN DevCPM.err(139)
ELSE
tag.mode := Ind; tag.reg := AX; tag.scale := 0; tag.offset := Tag0Offset + 4 * testtyp.extlev; tag.form := Pointer;
DevCPL486.MakeConst(tdes, 0, Pointer); tdes.obj := DevCPE.TypeObj(testtyp);
DevCPL486.GenComp(tdes, tag);
setCC(x, eql, FALSE, FALSE)
END
END ShortTypTest;