Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions src/bap/bir.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,16 @@ class Attrs(Map) :
class Attr(ADT) :
"""Attribute is a pair of attribute name and value,
both represented with str"""
pass

@property
def name(self):
"""name of attribute"""
return self.arg[0]

@property
def value(self):
"""value of attribute"""
return self.arg[1]

class Values(Map) :
"""A set of possible values, taken by a phi-node.
Expand Down Expand Up @@ -362,7 +371,15 @@ class Annotation(ADT) :
Each annotation denotes an association between a memory region and
some arbitrary property, denoted with an attribute.
"""
pass
@property
def region(self):
"""memory region"""
return self.arg[0]

@property
def attr(self):
"""memory region attribute"""
return self.arg[1]

def parse_addr(str):
return int(str.split(':')[0],16)
Expand Down