Skip to content
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.

Don't use eval() in read_bss_sections #37

Open
kanzure opened this issue Sep 24, 2013 · 0 comments
Open

Don't use eval() in read_bss_sections #37

kanzure opened this issue Sep 24, 2013 · 0 comments

Comments

@kanzure
Copy link
Member

kanzure commented Sep 24, 2013

kanzure@deathfortress:~/code/pokecrystal$ python extras/pokemontools/gbz80disasm.py 0x45f
Traceback (most recent call last):
  File "extras/pokemontools/gbz80disasm.py", line 934, in <module>
    disasm.initialize()
  File "extras/pokemontools/gbz80disasm.py", line 619, in initialize
    self.wram.initialize()
  File "/home/kanzure/code/pokecrystal/extras/pokemontools/wram.py", line 106, in initialize
    self.setup_wram_sections()
  File "/home/kanzure/code/pokecrystal/extras/pokemontools/wram.py", line 128, in setup_wram_sections
    self.wram_sections = self.read_wram_sections()
  File "/home/kanzure/code/pokecrystal/extras/pokemontools/wram.py", line 121, in read_wram_sections
    wram_sections = read_bss_sections(wram_content)
  File "/home/kanzure/code/pokecrystal/extras/pokemontools/wram.py", line 48, in read_bss_sections
    length = eval(line[3:line.find(';')].replace('$','0x'))
  File "<string>", line 1, in <module>
NameError: name 'OBJECT_LENGTH' is not defined

Using eval is wrong many times over. Let's use something else.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant