@@ -836,12 +836,14 @@ public SLExpression translate(
836836 throws SLTranslationException {
837837 checkParameters (params ,
838838 ImmutableList .class ,
839+ Map .class ,
839840 Services .class );
840841 final ImmutableList <SLExpression > list = (ImmutableList ) params [0 ];
841842 final Map <LocationVariable ,Term > atPres = (Map ) params [1 ];
842843 final Services services = (Services ) params [2 ];
844+ final LocationVariable baseHeap = services .getTypeConverter ().getHeapLDT ().getHeap ();
843845
844- if (atPres == null || atPres .get (TB . getBaseHeap ( services ) ) == null ) {
846+ if (atPres == null || atPres .get (baseHeap ) == null ) {
845847 throw excManager .createException ("\\ fresh not allowed in this context" );
846848 }
847849
@@ -855,14 +857,16 @@ public SLExpression translate(
855857 t = TB .and (t ,
856858 TB .equals (TB .select (services ,
857859 tc .getBooleanLDT ().targetSort (),
858- atPres .get (TB . getBaseHeap ( services ) ),
860+ atPres .get (baseHeap ),
859861 expr .getTerm (),
860862 TB .func (tc .getHeapLDT ().getCreated ())),
861863 TB .FALSE (services )));
864+ // add non-nullness (bug #1364)
865+ t = TB .and (t , TB .not (TB .equals (expr .getTerm (),TB .NULL (services ))));
862866 } else if (expr .getTerm ().sort ().extendsTrans (tc .getLocSetLDT ().targetSort ())) {
863867 t = TB .and (t , TB .subset (services ,
864868 expr .getTerm (),
865- TB .freshLocs (services , atPres .get (TB . getBaseHeap ( services ) ))));
869+ TB .freshLocs (services , atPres .get (baseHeap ))));
866870 } else {
867871 throw excManager .createException ("Wrong type: " + expr );
868872 }
0 commit comments