Skip to content

NameError: global name 'Tid' is not defined #699

Closed
@frapik99

Description

@frapik99

Hi @ivg,
I'm doing few experiments with BAP but I had this weird error:

Code

In [1]: import bap
In [2]: proj = bap.run("malloc")
In [3]: main = proj.program.subs.find('main')
In [4]: entry = main.blks[0]
In [5]: next = main.blks.find(entry.jmps[0].target.arg)

malloc


int sum(int a, int b) {
	return a + b;
}

int main() {
	int a = 3;
	
	if ( a > 2 )
		malloc(sum(1,2));
	else
		exit(1);
}

Error

NameError                                 Traceback (most recent call last)
<ipython-input-5-6b244e5712d4> in <module>()
----> 1 next = main.blks.find(entry.jmps[0].target.arg)

/usr/local/lib/python2.7/dist-packages/bap/adt.pyc in find(self, key, d)
    491         if isinstance(key,str):
    492             test = by_name
--> 493         elif isinstance(key,Tid):
    494             test = by_id
    495         elif isinstance(key,Int):

NameError: global name 'Tid' is not defined

Am I doing something wrong?

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions