Opened 11 years ago

Last modified 11 years ago

#511 new bug

list assignment from returned reference (forbidden/incorrect)

Reported by: kroeker@… Owned by: hannes
Priority: minor Milestone: Release 4-0-0
Component: dontKnow Version: spielwiese
Keywords: reference list return bug assignment Cc:

Description

Hello,

recently I observed a bug, namely that it is possible to assign a list from a returned list reference ( should this be allowed? );

resulting in unexpected behaviour; see minimal example below:

system("reference");

proc returnListReference( listReference ) {

return (listReference);

}

list originalList ; originalList [1]= "c";

reference originalListRef = originalList;

list assignment from returned reference list returnedList = returnListReference( originalListRef ); bug! returnedList;

if (not (typeof(returnedList[1])=="string") ) { ERROR("bug in returning references; first entry is not a string but a complete list! "); }

Change History (2)

comment:1 Changed 11 years ago by boehm

Owner: changed from somebody to hannes

comment:2 Changed 11 years ago by kroeker@…

updated code formatting for minimal failing example:

system("reference");

proc returnListReference( listReference )
{
   return (listReference);
}

list originalList ;
originalList [1]= "c";

reference originalListRef = originalList;

//list assignment from returned reference
list returnedList = returnListReference( originalListRef ); //bug!
returnedList;

if (not (typeof(returnedList[1])=="string") )
{ ERROR("bug in returning references; first entry is not a string but a complete list! "); }

Note: See TracTickets for help on using tickets.