issue-#126 Compiler TRAP for SYSTEM.VAL(LONGINT, intreg)

User avatar
Josef Templ
Posts: 2047
Joined: Tue Sep 17, 2013 6:50 am

Re: issue-#126 Compiler TRAP for SYSTEM.VAL(LONGINT, intreg)

Post by Josef Templ »

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:

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;
- Josef
User avatar
DGDanforth
Posts: 1061
Joined: Tue Sep 17, 2013 1:16 am
Location: Palo Alto, California, USA
Contact:

Re: issue-#126 Compiler TRAP for SYSTEM.VAL(LONGINT, intreg)

Post by DGDanforth »

So Josef,
Do you want to officially change your submission from "RETURN' to "ELSE"?
We have a vote for "RETURN" that has been passed.
Shall I asked for a revote with "ELSE"?
-Doug
Zinn
Posts: 476
Joined: Tue Mar 25, 2014 5:56 pm
Location: Frankfurt am Main
Contact:

Re: issue-#126 Compiler TRAP for SYSTEM.VAL(LONGINT, intreg)

Post by Zinn »

The solution with else is better as the the solution with return only. We needn't vote again. The difference is ok. Just use Josef's latest solution.
- Helmut
Ivan Denisov
Posts: 1700
Joined: Tue Sep 17, 2013 12:21 am
Location: Russia

Re: issue-#126 Compiler TRAP for SYSTEM.VAL(LONGINT, intreg)

Post by Ivan Denisov »

Do not forget to close the issue before merge ;)
http://redmine.blackboxframework.org/issues/126
User avatar
DGDanforth
Posts: 1061
Joined: Tue Sep 17, 2013 1:16 am
Location: Palo Alto, California, USA
Contact:

Re: issue-#126 Compiler TRAP for SYSTEM.VAL(LONGINT, intreg)

Post by DGDanforth »

Done. Closed, pulled, and merged.
Post Reply