[ scummvm-Bugs-1224968 ] SKY: Bogus code

SourceForge.net noreply at sourceforge.net
Tue Jun 21 18:51:27 CEST 2005


Bugs item #1224968, was opened at 2005-06-21 18:51
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=418820&aid=1224968&group_id=37116

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: Beneath a Steel Sky
Status: Open
Resolution: None
Priority: 5
Submitted By: Max Horn (fingolfin)
Assigned to: Oliver Kiehl (olki)
Summary: SKY: Bogus code

Initial Comment:
GCC 4 produces the following warning:

sky/logic.cpp: In member function ‘uint16
Sky::Logic::script(uint16, uint16)’:
sky/logic.cpp:1340: warning: operation on ‘scriptData’
may be undefined

Indeed, that code is not well-defined: 
  scriptData += READ_LE_UINT16(scriptData++)/2 - 1;

In particular, depending on the compiler, scriptData might
end up off by one in either direction. The change was
introduced by olki here:

 <http://cvs.sourceforge.net/viewcvs.py/scummvm/scummvm/sky/
logic.cpp?r1=1.84&r2=1.85>

Looking at the old code, I believe this line should really
be:

  scriptData += READ_LE_UINT16(scriptData)/2;

I might be mistaken, though.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=418820&aid=1224968&group_id=37116




More information about the Scummvm-tracker mailing list