Avoid shifting into sign bit
It's undefined behavior. Found with gcc -fsanitize=undefined. Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
This commit is contained in:
parent
d58bea5458
commit
b9375b14b1
2 changed files with 2 additions and 2 deletions
|
@ -52,7 +52,7 @@
|
|||
#endif
|
||||
|
||||
#ifndef bit
|
||||
#define bit(x) (1<<(x))
|
||||
#define bit(x) (1U<<(x))
|
||||
#endif
|
||||
|
||||
#define minutes(x) (60*(x))
|
||||
|
|
|
@ -97,7 +97,7 @@ verify_tabref(int type, int row, struct castr *ca, int idx, long val)
|
|||
if (CANT_HAPPEN(ca_sym != symbol_ca))
|
||||
return -1;
|
||||
for (i = 0; i < (int)sizeof(long) * 8; i++) {
|
||||
if (val & (1L << i)) {
|
||||
if (val & (1UL << i)) {
|
||||
if (!symbol_by_value(1L << i, ef_ptr(tabno, 0))) {
|
||||
verify_fail(type, row, ca, idx,
|
||||
"bit %d is not in symbol table %s",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue