ContextAnalysis: Track local variables and function parameters separately.
This enables us to add all local variable Definitions to the DAST so that downstream visitors don't need to compute the local variables of a function again.
This commit is contained in:
@@ -17,7 +17,7 @@ public class FieldAssignmentTest {
|
||||
ContextAnalysis ctxAnal = new ContextAnalysis(funcs, structs, enums);
|
||||
|
||||
Exception e = assertThrows(RuntimeException.class, () -> ctxAnal.visit(tree));
|
||||
assertEquals("Error in line 1:46 Variable with name str not defined.", e.getMessage());
|
||||
assertEquals("Error in line 1:46 Variable or parameter with name \"str\" not defined.", e.getMessage());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -29,6 +29,6 @@ public class FieldAssignmentTest {
|
||||
ContextAnalysis ctxAnal = new ContextAnalysis(funcs, structs, enums);
|
||||
|
||||
Exception e = assertThrows(RuntimeException.class, () -> ctxAnal.visit(tree));
|
||||
assertEquals("Error in line 1:62 Variable must reference a struct but references int.", e.getMessage());
|
||||
assertEquals("Error in line 1:62 Variable or parameter must reference a struct but references int.", e.getMessage());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user