Page 7 of 7

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

Posted: Fri Sep 02, 2016 4:25 am
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

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

Posted: Fri Sep 02, 2016 4:40 am
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

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

Posted: Fri Sep 02, 2016 5:58 am
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

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

Posted: Fri Sep 02, 2016 6:42 am
by Ivan Denisov
Do not forget to close the issue before merge ;)
http://redmine.blackboxframework.org/issues/126

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

Posted: Fri Sep 02, 2016 8:45 am
by DGDanforth
Done. Closed, pulled, and merged.