[quake3-bugzilla] [Bug 6432] New: Undefined behavior

bugzilla-daemon at icculus.org bugzilla-daemon at icculus.org
Wed Jun 22 10:19:19 EDT 2016


https://bugzilla.icculus.org/show_bug.cgi?id=6432

            Bug ID: 6432
           Summary: Undefined behavior
           Product: ioquake3
           Version: GIT MASTER
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P3
         Component: Platform
          Assignee: zachary at ioquake.org
          Reporter: mine at ukr.net
        QA Contact: quake3-bugzilla at icculus.org

Created attachment 3558
  --> https://bugzilla.icculus.org/attachment.cgi?id=3558&action=edit
Suggested solution

Undefined behavior in shift operation if shift counter is greater or equal 32
(MAX_DLIGHTS atm): 

R_RecursiveWorldNode( tr.world->nodes, 15, ( 1 << tr.refdef.num_dlights ) - 1
);

So, for example, on x86 arch ((1<<[volatile]32)-1) produces 0x0 instead of
0xFFFFFFFF because shift counter is masked to 5 bits

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://icculus.org/pipermail/quake3-bugzilla/attachments/20160622/bd59e0e2/attachment.html>


More information about the quake3-bugzilla mailing list