summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Source/Core/AbsyCmd.cs2
-rw-r--r--Test/test0/LineResolve.bpl5
-rw-r--r--Test/test0/LineResolve.bpl.expect3
3 files changed, 8 insertions, 2 deletions
diff --git a/Source/Core/AbsyCmd.cs b/Source/Core/AbsyCmd.cs
index 72dc7c86..1922f977 100644
--- a/Source/Core/AbsyCmd.cs
+++ b/Source/Core/AbsyCmd.cs
@@ -1224,7 +1224,7 @@ namespace Microsoft.Boogie {
for (int i = 0; i < Lhss.Count; i++)
{
var lhs = Lhss[i].AsExpr as IdentifierExpr;
- if (lhs != null && QKeyValue.FindBoolAttribute(lhs.Decl.Attributes, "assumption"))
+ if (lhs != null && lhs.Decl != null && QKeyValue.FindBoolAttribute(lhs.Decl.Attributes, "assumption"))
{
var rhs = Rhss[i] as NAryExpr;
if (rhs == null
diff --git a/Test/test0/LineResolve.bpl b/Test/test0/LineResolve.bpl
index da1a5bfa..39bf9983 100644
--- a/Test/test0/LineResolve.bpl
+++ b/Test/test0/LineResolve.bpl
@@ -38,3 +38,8 @@ l+ // error: A B C . txt(12,0)
0;
}
+
+#line 100 LineResolve.bpl
+procedure ResolutionTest() {
+ x := 0; // error: undeclared identifier (once upon a time, this used to crash Boogie)
+}
diff --git a/Test/test0/LineResolve.bpl.expect b/Test/test0/LineResolve.bpl.expect
index 6ca45551..1e5b4eb7 100644
--- a/Test/test0/LineResolve.bpl.expect
+++ b/Test/test0/LineResolve.bpl.expect
@@ -10,4 +10,5 @@ Abc.txt(13,0): Error: undeclared identifier: i
Abc.txt(99,0): Error: undeclared identifier: j
c:\Users\leino\Documents\Programs\MyClass.ssc(104,0): Error: undeclared identifier: k
A B C . txt(12,0): Error: undeclared identifier: l
-12 name resolution errors detected in LineResolve.bpl
+LineResolve.bpl(101,2): Error: undeclared identifier: x
+13 name resolution errors detected in LineResolve.bpl