Page 1 of 1

Compile crashes on empty with

Posted: Wed Jul 20, 2016 3:44 pm
by X512
Following sequence causes trap in compiler code:

Code: Select all

WITH
ELSE
END;
According language report this code seems to be valid. With without else doesn't crash.

Re: Compile crashes on empty with

Posted: Thu Jul 21, 2016 8:11 am
by Josef Templ
This should be easy to fix.

The syntax of the WITH statement in Component Pascal has been slightly extended over original Oberon.
The intention obviously was to allow a vertical bar "|" also before the first guarded statement sequence.
However, the syntax changes go further and allow constructs like this one:

WITH ||||||||||||||| END

This is not very meaningful but because it was possible it cannot be changed now.
It is certainly better to fix the bug in the code generator.

- Josef

Re: Compile crashes on empty with

Posted: Wed Aug 24, 2016 7:36 pm
by luowy
the fixup , DevCPP.StatSeq

Code: Select all

			END;
				e := sym = else; pos := DevCPM.startpos;
				IF x = NIL THEN err(130);END; (* add this line*)
				IF e THEN DevCPS.Get(sym); StatSeq(s) ELSE s := NIL END ;
				DevCPB.Construct(Nwith, x, s); CheckSym(end);
				IF e THEN x.subcl := 1 END
			ELSIF sym = exit THEN
			.....
		END
	END StatSeq;
luowy

Re: Compile crashes on empty with

Posted: Thu Aug 25, 2016 8:20 am
by Robert

Re: Compile crashes on empty with

Posted: Thu Mar 30, 2017 3:02 am
by Ivan Denisov