Fix heap use after free in compiler.c

This commit is contained in:
solar-mist
2022-08-22 18:48:44 +00:00

View File

@@ -33,6 +33,11 @@ static bool checkType(Literal typeLiteral, Literal value) {
return false; return false;
} }
//always allow null values
if (IS_NULL(value)) {
return true;
}
//for each type, if a mismatch is found, return false //for each type, if a mismatch is found, return false
if (AS_TYPE(typeLiteral).typeOf == LITERAL_BOOLEAN && !IS_BOOLEAN(value)) { if (AS_TYPE(typeLiteral).typeOf == LITERAL_BOOLEAN && !IS_BOOLEAN(value)) {
return false; return false;