[Ooc-checkins] ooc2/src/OOC IR.Mod,1.289,1.290
Brought to you by:
mva
From: Michael v. A. <mv...@us...> - 2006-06-27 19:12:55
|
Update of /cvsroot/ooc/ooc2/src/OOC In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv20786/src/OOC Modified Files: IR.Mod Log Message: Disallow NEW for NO_DESCRIPTOR and NO_LENGTH_INFO pointers. Index: IR.Mod =================================================================== RCS file: /cvsroot/ooc/ooc2/src/OOC/IR.Mod,v retrieving revision 1.289 retrieving revision 1.290 diff -u -d -r1.289 -r1.290 --- IR.Mod 8 Oct 2005 15:52:24 -0000 1.289 +++ IR.Mod 27 Jun 2006 19:12:52 -0000 1.290 @@ -1,7 +1,7 @@ (* $Id$ *) MODULE OOC:IR [OOC_EXTENSIONS]; (* High-level intermediate code representation. - Copyright (C) 2001-2005 Michael van Acken, Stewart Greenhill + Copyright (C) 2001-2006 Michael van Acken, Stewart Greenhill This file is part of OOC. @@ -1220,6 +1220,7 @@ notIteratorObject = 77; noNextMethod = 78; notSetType = 79; + newNotApplicable = 80; TYPE ErrorContext = POINTER TO ErrorContextDesc; @@ -1444,6 +1445,8 @@ t := "The iterator object has no Next() method with a valid signature"; | notSetType: t := "Not a set type"; + | newNotApplicable: + t := "Builtin NEW() is not applicable to this pointer type"; END; context. BaseTemplate (msg, t, templ) END GetTemplate; @@ -6319,6 +6322,10 @@ ELSIF (type IS Sym.Pointer) THEN b.AssertVar(arguments[0]); type := type(Sym.Pointer).baseType.Deparam(); + IF ~type.hasDescriptor OR + (type IS Sym.Array) & ~type(Sym.Array).hasLengthInfo THEN + b.ErrSym(newNotApplicable, arguments[0].sym); + END; IF (type IS Sym.Array) THEN dim := 1+type(Sym.Array).GetOpenDimensions(); IF CheckNumberOfArguments (dim, dim) THEN |