<< Back to previous view

[PCC-393] Found usage of uninitialized variable in file /pcc-1.0.0/arch/hppa/code.c at line 149 Created: 06/Jun/12  Updated: 06/Jun/12

Status: Resolved
Project: pcc
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Critical
Reporter: Martin Ettl Assignee: Anders Magnusson
Resolution: Fixed Votes: 0


 Description   
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


 Comments   
Comment by Anders Magnusson [ 06/Jun/12 11:29 AM ]
True; this was still wrong in -current. FIxed now, thanks.
Generated at Thu Dec 18 22:43:49 CET 2014 using JIRA Enterprise Edition, Version: 3.13.1-#333.