I don't know what you and X512 are talking about.Ivan Denisov wrote: I agree with X512. The TRAP should be replaced to warning.
The TRAP is fixed. Isn't this enough?
I don't know what you and X512 are talking about.Ivan Denisov wrote: I agree with X512. The TRAP should be replaced to warning.
Misunderstanding was because the initial discussion was about low-level memory manipulations:Josef Templ wrote:I don't know what you and X512 are talking about.Ivan Denisov wrote: I agree with X512. The TRAP should be replaced to warning.
The TRAP is fixed. Isn't this enough?
I agree. This is not good now, that the error displayed in the beginning of the line.luowy wrote:IMO,it is not complete.
Josef fixed the bug at the beckend by add a 'RETURN' ,that stop the propagation of the error which causing the trap.
but it can only get the error position of the statement, instead of the error expression.
One of features of Oberon compiler beyond most C compiler is the giving error positions of expression instead of line numbers .
Why LuoWy fix is not sufficient for you? You did not provide any arguments when rejecting it.Josef Templ wrote:You can make a proposal for a better error position together with its implementation,
but, please, DON'T COMMIT IT.
It can be elegant from inside, but looks ugly outside. It does not show the place of error.Josef Templ wrote:The fix is of exceptional simplicity and elegance.
It is sad that you don't recognize the simplicity and elegance of the fix.
The fix does not change anything except that it avoids a follow-up error
after detecting an error because something cannot be re-interpreted.
Code: Select all
PROCEDURE Convert* (VAR x: DevCPL486.Item; f: BYTE; size: INTEGER; hint, stop: SET); (* size >= 0: sysval *)
VAR y: DevCPL486.Item;
BEGIN
ASSERT(x.mode # Con);
IF (size >= 0)
& ((size # x.typ.size) & ((size > 4) OR (x.typ.size > 4))
OR (f IN {Comp, Real64}) & (x.mode IN {Reg, Stk})
OR (f = Int64) & (x.mode = Stk)) THEN DevCPM.err(220)
ELSE
y.mode := Undef; y.form := f; ConvMove(y, x, size >= 0, hint, stop)
END
END Convert;
Code: Select all
PROCEDURE Convert* (VAR x: DevCPL486.Item; f: BYTE; size: INTEGER; hint, stop: SET); (* size >= 0: sysval *)
VAR y: DevCPL486.Item;
BEGIN
ASSERT(x.mode # Con);
IF (size >= 0)
& ((size # x.typ.size) & ((size > 4) OR (x.typ.size > 4))
OR (f IN {Comp, Real64}) & (x.mode IN {Reg, Stk})
OR (f = Int64) & (x.mode = Stk)) THEN DevCPM.err(220) END;
y.mode := Undef; y.form := f; ConvMove(y, x, size >= 0, hint, stop)
END Convert;