forked from diffblue/cbmc
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prefix temporary var names with function id
Temporary variable names must be globally unique and changing the number of temporaries in one function must not change a variable name in another function. Otherwise, this has adverse effects on goto-diff. This commit gets rid of various global temporary variables counters that do not meet above criteria. Instead, we now always use the function id to prefix temporaries to eliminate cross-function effects and increment the numeric suffix only when the entire variable name already exists, using the rename facility.
- Loading branch information
1 parent
ca678aa
commit 9f0626c
Showing
21 changed files
with
312 additions
and
243 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,7 @@ Author: Reuben Thomas, [email protected] | |
#include <java_bytecode/java_object_factory.h> // gen_nondet_init | ||
|
||
#include <util/irep_ids.h> | ||
#include <util/fresh_symbol.h> | ||
|
||
#include <memory> | ||
|
||
|
@@ -135,11 +136,13 @@ void convert_nondet( | |
message_handlert &message_handler, | ||
const object_factory_parameterst &object_factory_parameters) | ||
{ | ||
object_factory_parameterst parameters = object_factory_parameters; | ||
parameters.function_id = function.get_function_id(); | ||
convert_nondet( | ||
function.get_goto_function().body, | ||
function.get_symbol_table(), | ||
message_handler, | ||
object_factory_parameters); | ||
parameters); | ||
|
||
function.compute_location_numbers(); | ||
} | ||
|
@@ -158,6 +161,8 @@ void convert_nondet( | |
|
||
if(symbol.mode==ID_java) | ||
{ | ||
object_factory_parameterst parameters = object_factory_parameters; | ||
parameters.function_id = f_it.first; | ||
convert_nondet( | ||
f_it.second.body, | ||
symbol_table, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.