Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 146757 - local variable used before set
Summary: local variable used before set
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: gtkhtml3
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Dave Malcolm
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: FC5Target
TreeView+ depends on / blocked
 
Reported: 2005-02-01 12:05 UTC by David Binderman
Modified: 2007-11-30 22:10 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2005-08-18 20:10:58 UTC


Attachments (Terms of Use)

Description David Binderman 2005-02-01 12:05:29 UTC
Description of problem:

I just tried to compile package gtkhtml3-3.5.4-1 from 
Redhat Fedora development tree.

The compiler said

htmltextslave.c(184): remark #592: variable "gi" is used before its
value is set

The source code is

                HTMLTextSlaveGlyphItem *gi = (HTMLTextSlaveGlyphItem
*) gi;

                if (gi->type == HTML_TEXT_SLAVE_GLYPH_ITEM_CREATED) {

Bizzare code. gi gets initialised with it's own (undefined) value,
and then it gets used as a valid pointer in the if statement.

Suggest code re-work. Has this code ever been tested ?


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 1 Dave Malcolm 2005-08-18 03:50:07 UTC
Thanks for this report.

I agree that this code is bizarre, and will work on getting it fixed upstream.

Comment 2 Dave Malcolm 2005-08-18 20:10:58 UTC
It's been fixed in upstream CVS:
http://cvs.gnome.org/viewcvs/gtkhtml/src/htmltextslave.c?r1=1.188.2.3&r2=1.188.2.4

Bug was fixed by gtkhtml-3.7.5, so fixed it's fixed in rawhide.
Bug exists from gtkhtml-3.5.3 to gtkhtml-3.6.2, so potentially affects FC4, but
does not affect FC3.



Note You need to log in before you can comment on or make changes to this bug.