diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/ChangeLog | 11 | ||||
-rw-r--r-- | src/interp/nruncomp.boot | 18 | ||||
-rw-r--r-- | src/interp/wi2.boot | 6 | ||||
-rw-r--r-- | src/testsuite/interpreter/sf-2910351.input | 5 | ||||
-rw-r--r-- | src/testsuite/interpreter/sf-2910351.spad | 17 |
5 files changed, 45 insertions, 12 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 67bb3697..63244e90 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,14 @@ +2010-02-14 Gabriel Dos Reis <gdr@cse.tamu.edu> + + Fix SF/2910351 + * interp/nruncomp.boot (deltaTran): Avoid use of user-visible + names for compiler internal tags. + (genDeltaEntry): Likewise. + (NRTassocIndex): Likewise. + (NRTgetLocalIndex): Likewise. + (NRTsubstDelta): Likewise. + * interp/wi2.boot (genDeltaEntry): Likewise. + 2010-02-14 Waldek Hebisch <hebisch@math.uni.wroc.pl> Gabriel Dos Reis <gdr@cs.tamu.edu> diff --git a/src/interp/nruncomp.boot b/src/interp/nruncomp.boot index c0fdeda4..1b969ae2 100644 --- a/src/interp/nruncomp.boot +++ b/src/interp/nruncomp.boot @@ -1,6 +1,6 @@ -- Copyright (c) 1991-2002, The Numerical Algorithms Group Ltd. -- All rights reserved. --- Copyright (C) 2007-2009, Gabriel Dos Reis. +-- Copyright (C) 2007-2010, Gabriel Dos Reis. -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without @@ -95,8 +95,8 @@ NRTaddDeltaCode() == nil deltaTran(item,compItem) == - item is ['domain,lhs,:.] => NRTencode(lhs,compItem) - --NOTE: all items but signatures are wrapped with domain forms + --NOTE: all items but signatures are wrapped with %domain forms + item is ["%domain",lhs,:.] => NRTencode(lhs,compItem) [op,:modemap] := item [dcSig,[.,[kind,:.]]] := modemap [dc,:sig] := dcSig @@ -203,8 +203,8 @@ genDeltaEntry opMmPair == [op,[dc,:[NRTgetLocalIndex x for x in nsig]],["T",cform]] -- force pred to T if null NRTassocIndex dc and (member(dc,$functorLocalParameters) or not atom dc) then - --create "domain" entry to $NRTdeltaList - $NRTdeltaList:= [['domain,NRTaddInner dc,:dc],:$NRTdeltaList] + --create "%domain" entry to $NRTdeltaList + $NRTdeltaList:= [["%domain",NRTaddInner dc,:dc],:$NRTdeltaList] saveNRTdeltaListComp:= $NRTdeltaListComp:=[nil,:$NRTdeltaListComp] $NRTdeltaLength := $NRTdeltaLength+1 compEntry:= (compOrCroak(odc,$EmptyMode,$e)).expr @@ -229,7 +229,7 @@ NRTassocIndex x == null x => x x = $NRTaddForm => 5 k := or/[i for i in 1.. for y in $NRTdeltaList - | first y = "domain" and second y = x] => + | first y = "%domain" and second y = x] => $NRTbase + $NRTdeltaLength - k nil @@ -243,7 +243,7 @@ NRTgetLocalIndex item == MEMQ(item,$formalArgList) => item nil atom item and null value => --give slots to atoms - $NRTdeltaList:= [['domain,NRTaddInner item,:value],:$NRTdeltaList] + $NRTdeltaList:= [["%domain",NRTaddInner item,:value],:$NRTdeltaList] $NRTdeltaListComp:=[item,:$NRTdeltaListComp] index := $NRTbase + $NRTdeltaLength -- slot number to return $NRTdeltaLength := $NRTdeltaLength+1 @@ -251,7 +251,7 @@ NRTgetLocalIndex item == -- when assigning slot to flag values, we don't really want to -- compile them. Rather, we want to record them as if they were atoms. flag := isQuasiquote item - $NRTdeltaList:= [['domain, NRTaddInner item,:value], :$NRTdeltaList] + $NRTdeltaList:= [["%domain", NRTaddInner item,:value], :$NRTdeltaList] -- remember the item's place in the `delta list' and its slot number -- before the recursive call to the compiler, as that might generate -- more references that would extend the `delta list'. @@ -710,7 +710,7 @@ NRTsubstDelta(initSig) == t = 2 => '_$_$ t = 5 => $NRTaddForm u:= $NRTdeltaList.($NRTdeltaLength+5-t) - first u = 'domain => second u + first u = "%domain" => second u error "bad $NRTdeltaList entry" first t in '(Mapping Union Record _:) => [first t,:[replaceSlotTypes(x) for x in rest t]] diff --git a/src/interp/wi2.boot b/src/interp/wi2.boot index e3871acb..b4e4c7f5 100644 --- a/src/interp/wi2.boot +++ b/src/interp/wi2.boot @@ -1,6 +1,6 @@ -- Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd. -- All rights reserved. --- Copyright (C) 2007-2009, Gabriel Dos Reis. +-- Copyright (C) 2007-2010, Gabriel Dos Reis. -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without @@ -717,8 +717,8 @@ genDeltaEntry opMmPair == [op,[dc,:[genDeltaSig x for x in sig]],['T,cform]] -- force pred to T if null NRTassocIndex dc and (member(dc,$functorLocalParameters) or null atom dc) then - --create "domain" entry to $NRTdeltaList - $NRTdeltaList:= [['domain,NRTaddInner dc,:dc],:$NRTdeltaList] + --create "%domain" entry to $NRTdeltaList + $NRTdeltaList:= [["%domain",NRTaddInner dc,:dc],:$NRTdeltaList] saveNRTdeltaListComp:= $NRTdeltaListComp:=[nil,:$NRTdeltaListComp] $NRTdeltaLength := $NRTdeltaLength+1 compEntry:= diff --git a/src/testsuite/interpreter/sf-2910351.input b/src/testsuite/interpreter/sf-2910351.input new file mode 100644 index 00000000..50eaca6b --- /dev/null +++ b/src/testsuite/interpreter/sf-2910351.input @@ -0,0 +1,5 @@ +)co sf-2910351 + +x : Identifier := 'PlaneAlgebraicCurvePlot + +getCtorKindInString(x)$Bug diff --git a/src/testsuite/interpreter/sf-2910351.spad b/src/testsuite/interpreter/sf-2910351.spad new file mode 100644 index 00000000..f634e077 --- /dev/null +++ b/src/testsuite/interpreter/sf-2910351.spad @@ -0,0 +1,17 @@ + +)abbrev package BUG Bug +Bug(): Public == Private where + Public == with + getCtorKindInString: Identifier -> String + getCtorKind: Identifier -> ConstructorKind + Private == add + getCtorKind(c: Identifier): ConstructorKind == + kind(retract(findConstructor(c)$Constructor)$(Maybe Constructor))$Constructor + + getCtorKindInString(c: Identifier): String == + k : ConstructorKind := getCtorKind(c) + k = category$ConstructorKind => "Category" + k = package$ConstructorKind => "Package" + k = domain$ConstructorKind => "Domain" + "unknown constructor kind! " + |