shithub: MicroHs

Download patch

ref: 48a34d1eb8df3def243689c0c5be2d5b3000a90c
parent: 8363022e68ba1fe71213a89ba4881d8e65533738
author: Lennart Augustsson <lennart@augustsson.net>
date: Sun Apr 7 16:53:54 EDT 2024

Add missing argument satisfaction checks.

--- a/src/runtime/eval.c
+++ b/src/runtime/eval.c
@@ -2679,6 +2679,7 @@
   case T_ULE:
   case T_UGT:
   case T_UGE:
+    CHECK(2);
     n = ARG(TOP(1));
     if (GETTAG(n) == T_INT) {
       n = ARG(TOP(0));
@@ -2691,6 +2692,7 @@
     goto top;
   case T_NEG:
   case T_INV:
+    CHECK(1);
     n = ARG(TOP(0));
     PUSH(combUNINT1);
     goto top;
@@ -2706,10 +2708,12 @@
   case T_FLE:
   case T_FGT:
   case T_FGE:
+    CHECK(2);
     n = ARG(TOP(1));
     PUSH(combBINDBL2);
     goto top;
   case T_FNEG:
+    CHECK(1);
     n = ARG(TOP(0));
     PUSH(combUNDBL1);
     goto top;
--