Issue Details (XML | Word | Printable)

Key: PCC-393
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Critical Critical
Assignee: Anders Magnusson
Reporter: Martin Ettl
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
pcc

Found usage of uninitialized variable in file /pcc-1.0.0/arch/hppa/code.c at line 149

Created: 06/Jun/12 10:45 AM   Updated: 06/Jun/12 11:29 AM
Component/s: None
Affects Version/s: None
Fix Version/s: None


 Description  « Hide
I found a bug in pcc, where an uninitialized variable is used.

Please take a look at following code snippet from file /pcc-1.0.0/arch/hppa/code.c at line 149


void
bfcode(struct symtab **a, int cnt)
{
struct symtab *sp;
NODE *p, *q;
int i, n, sz; /* <-- variable is declared */

if (cftnsp->stype == STRTY+FTN || cftnsp->stype == UNIONTY+FTN) {
/* Function returns struct, adjust arg offset */
for (i = 0; i < n; i++) /*<-- variable n is used uninitialized*/
a[i]->soffset += SZPOINT(LONG);
}
...
}

As you can see, the variable n is used uninitialized!

Best regards

Martin Ettl


 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Anders Magnusson made changes - 06/Jun/12 11:28 AM
Field Original Value New Value
Assignee Anders Magnusson [ ragge ]
Anders Magnusson added a comment - 06/Jun/12 11:29 AM
True; this was still wrong in -current. FIxed now, thanks.

Anders Magnusson made changes - 06/Jun/12 11:29 AM
Status Open [ 1 ] Resolved [ 5 ]
Resolution Fixed [ 1 ]