Fix crash caused by an incorrect node type check in codegen_masgn

Use the dedicated function `get_node_type(t)` to correctly determine the node type, instead of the incorrect `node_to_int(t->car)` check.

OSS-Fuzz issue details:
https://oss-fuzz.com/testcase-detail/4760884737277952
https://g-issues.oss-fuzz.com/issues/449498801
This commit is contained in:
Meder Kydyraliev
2025-10-17 10:03:01 +11:00
committed by GitHub
parent ee5a6705ee
commit af33eec793
+1 -1
View File
@@ -4386,7 +4386,7 @@ codegen_masgn(codegen_scope *s, node *varnode, node *rhs, int sp, int val)
node *t = rhs ? rhs : masgn_n->rhs, *p;
int rhs_reg = sp;
if (!val && t && node_to_int(t->car) == NODE_ARRAY && t->cdr && nosplat(t->cdr)) {
if (!val && t && get_node_type(t) == NODE_ARRAY && t->cdr && nosplat(t->cdr)) {
/* fixed rhs */
t = t->cdr;
while (t) {