Skip to content

Commit

Permalink
Bug with variable declaration inside if-else inside while
Browse files Browse the repository at this point in the history
  • Loading branch information
Miguel Isabel Márquez committed Sep 28, 2022
1 parent bdc9d9d commit 17ccb3f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions type_analysis/src/analyzers/unknown_known_analysis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,10 @@ fn analyze(stmt: &Statement, entry_information: EntryInformation) -> ExitInforma

if tag_out == Unknown{
for var in &exit.modified_variables{
let value = environment.get_mut_variable_or_break(var, file!(), line!());
*value = Unknown;
if environment.has_variable(var){
let value = environment.get_mut_variable_or_break(var, file!(), line!());
*value = Unknown;
}
}
}

Expand Down

0 comments on commit 17ccb3f

Please sign in to comment.