After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 662054 - rewrite.py: add basic variable lifetime tracking
rewrite.py: add basic variable lifetime tracking
Status: RESOLVED FIXED
Product: reinteract
Classification: Other
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: reinteract-maint
reinteract-maint
Depends on:
Blocks:
 
 
Reported: 2011-10-18 00:00 UTC by Owen Taylor
Modified: 2011-10-23 18:59 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
rewrite.py: add basic variable lifetime tracking (15.50 KB, patch)
2011-10-18 00:00 UTC, Owen Taylor
committed Details | Review

Description Owen Taylor 2011-10-18 00:00:48 UTC
I'm a little conflicted about this patch:

 * It's handles one important case - repeated uses of

    build UncopyableThing() as u:
       u.do_something()

 * It's pretty sound theoretically, and has full test cases.

 * But it's 200 lines of code to handle that one important case,
   which probably could have been handled with a 20 line hack.

Maybe some of the other cases it handles will come up in the future...
Comment 1 Owen Taylor 2011-10-18 00:00:51 UTC
Created attachment 199287 [details] [review]
rewrite.py: add basic variable lifetime tracking

Track when a variable is overwritten with a new value in a statement
before it is mutated. In this case, we don't need to copy the
pre-statement value.
Comment 2 Owen Taylor 2011-10-23 18:59:43 UTC
Attachment 199287 [details] pushed as bfcc9e1 - rewrite.py: add basic variable lifetime tracking