Fix issue #130; allow conversion from any pointer to uintptr and vice versa

This commit is contained in:
gingerBill
2017-11-02 22:34:09 +00:00
parent 529d1c78c7
commit fcc8b89e6b
2 changed files with 8 additions and 8 deletions

View File

@@ -1759,11 +1759,11 @@ bool check_is_castable_to(Checker *c, Operand *operand, Type *y) {
return true;
}
// (u)int <-> rawptr
if (is_type_uintptr(src) && is_type_rawptr(dst)) {
// (u)int <-> pointer
if (is_type_uintptr(src) && is_type_pointer(dst)) {
return true;
}
if (is_type_rawptr(src) && is_type_uintptr(dst)) {
if (is_type_pointer(src) && is_type_uintptr(dst)) {
return true;
}