mirror of
https://github.com/vishapoberon/compiler.git
synced 2026-04-06 15:42:25 +00:00
Fix array assignment size validation to accept equal sizes.
This commit is contained in:
parent
1e9c1af8ef
commit
e85091289e
2 changed files with 2 additions and 2 deletions
|
|
@ -790,7 +790,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96
|
||||||
OPM.WriteString("__X(");
|
OPM.WriteString("__X(");
|
||||||
OPC.Len(r.obj, r.typ, 0); OPM.WriteString(" * "); OPM.WriteInt(r.typ.BaseTyp.size);
|
OPC.Len(r.obj, r.typ, 0); OPM.WriteString(" * "); OPM.WriteInt(r.typ.BaseTyp.size);
|
||||||
OPM.WriteString(", ");
|
OPM.WriteString(", ");
|
||||||
OPM.WriteInt(l.typ.size);
|
OPM.WriteInt(l.typ.size+1); (* _X vaidates 0 .. n-1 so we need to +1. *)
|
||||||
OPM.Write(")")
|
OPM.Write(")")
|
||||||
ELSE (* Array to array copy. *)
|
ELSE (* Array to array copy. *)
|
||||||
ASSERT(r.typ.comp = OPT.Array); ASSERT(r.typ.size <= l.typ.size);
|
ASSERT(r.typ.comp = OPT.Array); ASSERT(r.typ.size <= l.typ.size);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue