atabac / python-on-a-chip

Automatically exported from code.google.com/p/python-on-a-chip
Other
0 stars 0 forks source link

Incorrect typecast in __bi.py #145

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. No errors are manifested

Please provide any additional information below.

On line 569 in lib/__bi.py: 
    /* Get the length of the sequence */
    ps = NATIVE_GET_LOCAL(0);
    if (OBJ_GET_TYPE(ps) == OBJ_TYPE_TUP)
    {
        len = ((pPmTuple_t)ps)->length;
    }
    else if (OBJ_GET_TYPE(ps) == OBJ_TYPE_LST)
    {
        len = ((pPmTuple_t)ps)->length;
    }

The list is cast into a tuple. This will work since the length variable happens 
to be in the same place for tuples and lists. But for OBJ_TYPE_LST the line 
should be: 

        len = ((pPmList_t)ps)->length;

Original issue reported on code.google.com by oscar.li...@gmail.com on 30 Sep 2010 at 6:17

GoogleCodeExporter commented 9 years ago
Great find.  Thank you.

Original comment by dwhall...@gmail.com on 30 Sep 2010 at 6:21

GoogleCodeExporter commented 9 years ago
r621
- Made change as suggested

Check in on branch ( 
https://python-on-a-chip.googlecode.com/svn/branches/issue_0100_dwhall_release_0
9 ) since trunk/ is frozen for the release process.

Original comment by dwhall...@gmail.com on 30 Sep 2010 at 6:28