Skip to content

Conversation

@sparkyparrot
Copy link

Add possibility to diff states in dump func of symbexec

"""

for variable, value in self.modified(None, ids, mems):
for variable, value in self.modified(dict(init_state_engine if init_state_engine is not None else {}), ids, mems):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe the patch be better with:

 def dump(self,init_state=None, ids=True, mems=True)
    ...
    if init_state is None:
        init_state ={}
    ...
    for variable, value in self.modified(init_state, ids, mems):
        ....

Is it ok for you ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm just note that modified doesnt take in a state instance as the name implies but a base dictionary as its commented in the source code (so a dict(state) )
@init_state: a base dictionary linking variables to their initial values

So I guess passing dict() of a StateEngine or correcting the modified func as well.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, as the state is a kind of dictionary, I may keep the dictionary as argument if you are ok with this (the .symbols return a dictionary as well)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All goodie then !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants