Opened 3 years ago

Closed 16 months ago

#7139 closed defect (fixed)

BBVS: Undefined behavior - shift of a negative value

Reported by: salty-horse Owned by: csnover
Priority: normal Component: Engine: BBVS
Keywords: Cc:
Game: Beavis & Butthead Virtual Stupidity

Description

In the Bug Justice minigame code, clang warns of bitwise shifts of a negative value, which are undefined behavior in C++:

engines/bbvs/minigames/bbant.cpp
591: obj->yIncr = (-1 << 16);
733: obj->x < (-10 << 16) || obj->x > (330 << 16) ||
734: obj->y < (-10 << 16) || obj->y > (250 << 16);
934: obj->yIncr = (-4 << 16);

Ticket imported from: bugs/7139.

Change History (1)

comment:1 Changed 16 months ago by csnover

Owner: set to csnover
Resolution: fixed
Status: newclosed

Oops, I fixed these in cc12c878b7faba373ac23aecf798f979122e5bd8 and didn’t even realise there was a ticket open for it.

Note: See TracTickets for help on using tickets.