michaelcmartin / Ophis

A cross-assembler for the 6502 series of microprocessors.
http://michaelcmartin.github.io/Ophis/
Other
96 stars 26 forks source link

Declare templabelcount as a global in atom(). #14

Closed catseye closed 11 years ago

catseye commented 12 years ago

I found this buglet using pyflakes -- templabelcount needs to be defined (at toplevel) and declared global in order for atom() to correctly see it. (Note, though, that I haven't tested this code path either before or after this change.)

michaelcmartin commented 11 years ago

This is technically safe as-is; templabelcount will be initialized or created by parse(), and only parse_line() updates it. atom() only reads the value.

However, the change does improve the robustness of the code should atom need to do updates later.