1
0
Fork 0
mirror of https://github.com/tobast/libunwind-eh_elf.git synced 2024-09-29 18:09:29 +02:00

(desc_is_active): Need to cast 1 to (unw_word_t) before shifting it by

a value that is potentially > 31.  Casting it to (unsigned long)
	is not enough on 32-bit platforms.
(create_state_record_for): Cast 0xf to (unw_word_t) instead of
	(unsigned long) to avoid losing bits on 32-bit platforms.

(Logical change 1.92)
This commit is contained in:
hp.com!davidm 2003-07-08 22:32:44 +00:00
parent 98b23722ae
commit a157d632f7

View file

@ -554,9 +554,9 @@ desc_is_active (unsigned char qp, unw_word t, struct ia64_state_record *sr)
return 0;
if (qp > 0)
{
if ((sr->pr_val & (1UL << qp)) == 0)
if ((sr->pr_val & ((unw_word_t) 1 << qp)) == 0)
return 0;
sr->pr_mask |= (1UL << qp);
sr->pr_mask |= ((unw_word_t) 1 << qp);
}
return 1;
}
@ -946,7 +946,8 @@ create_state_record_for (struct cursor *c, struct ia64_state_record *sr,
goto out;
}
sr->when_target = (3 * ((ip & ~0xfUL) - c->pi.start_ip) / 16 + (ip & 0xfUL));
sr->when_target = (3 * ((ip & ~(unw_word_t) 0xf) - c->pi.start_ip) / 16
+ (ip & 0xf));
if (c->pi.format == UNW_INFO_FORMAT_TABLE)
{