[bugfix] signedness of ret val from pic_int

This commit is contained in:
Yuichi Nishiwaki 2014-09-13 16:50:06 +09:00
parent 2bf2222519
commit 6bc702bd89
1 changed files with 8 additions and 1 deletions

View File

@ -63,7 +63,14 @@ pic_float(pic_value v)
return u.f;
}
#define pic_int(v) ((v) & 0xfffffffful)
static inline int
pic_int(pic_value v)
{
union { int i; unsigned u; } u;
u.u = v & 0xfffffffful;
return u.i;
}
#define pic_sym(v) ((v) & 0xfffffffful)
#define pic_char(v) ((v) & 0xfffffffful)