Add missing NULL check in CanBeType
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
//@error
|
||||
//assigning mismatched polymorphic types
|
||||
|
||||
export void foo(floating$0 bar) {
|
||||
export void foo(uniform floating$0 bar) {
|
||||
floating$1 baz = bar;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//@error
|
||||
//assigning mismatched polymorphic types
|
||||
|
||||
export void foo(number$0 bar) {
|
||||
floating$0 baz = bar;
|
||||
export void foo(uniform floating$0 bar) {
|
||||
integer baz = bar;
|
||||
}
|
||||
|
||||
2
type.cpp
2
type.cpp
@@ -855,6 +855,7 @@ PolyType::CanBeType(const Type *t) const {
|
||||
|
||||
const AtomicType *at = CastType<AtomicType>(t);
|
||||
|
||||
if (at) {
|
||||
switch (restriction) {
|
||||
case TYPE_INTEGER:
|
||||
return at->IsIntType();
|
||||
@@ -865,6 +866,7 @@ PolyType::CanBeType(const Type *t) const {
|
||||
default:
|
||||
FATAL("Unmatched case for polymorphic restriction");
|
||||
}
|
||||
}
|
||||
|
||||
// not an atomic type or polymorphic type
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user