This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2012年03月09日 10:04 by Mark.Shannon, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| uninitialised_descr.patch | Mark.Shannon, 2012年03月09日 10:04 | review | ||
| Messages (3) | |||
|---|---|---|---|
| msg155221 - (view) | Author: Mark Shannon (Mark.Shannon) * (Python committer) | Date: 2012年03月09日 10:04 | |
I get the following compiler warning (rev 2a142141e5fd) Its not strictly an error, but an unitialised variable in such an important function is dangerous. Objects/object.c: In function ‘_PyObject_GenericSetAttrWithDict’: Objects/object.c:1144: warning: ‘descr’ may be used uninitialised in this function Patch attached |
|||
| msg155257 - (view) | Author: Benjamin Peterson (benjamin.peterson) * (Python committer) | Date: 2012年03月09日 19:15 | |
Fixed in differently in 46e600fa8d05 Thanks anyway. |
|||
| msg155259 - (view) | Author: Jim Jewett (Jim.Jewett) * (Python triager) | Date: 2012年03月09日 19:23 | |
So the risk is that descr may be given garbage memory that just happens to look like an object with 1 reference, so that it really does a decref and tries to re-deallocate whatever was there before. I would rather see the change at the top of the function; just initialize descr to NULL when it is declared, and let the compiler figure out that it can skip the zeroing on some (most) paths. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:27 | admin | set | github: 58447 |
| 2012年03月09日 19:23:13 | Jim.Jewett | set | nosy:
+ Jim.Jewett messages: + msg155259 |
| 2012年03月09日 19:15:50 | benjamin.peterson | set | status: open -> closed resolution: out of date messages: + msg155257 |
| 2012年03月09日 17:18:56 | pitrou | set | nosy:
+ benjamin.peterson |
| 2012年03月09日 10:04:22 | Mark.Shannon | create | |