]> thyrsus.com Git - intercal.git/commitdiff
Fixes in the CREATE-operator code
authorAlex Smith <ais523@bham.ac.uk>
Tue, 24 Jun 2008 18:58:33 +0000 (14:58 -0400)
committerEric S. Raymond <esr@thyrsus.com>
Thu, 26 Aug 2010 00:35:00 +0000 (20:35 -0400)
src/feh2.c
src/ick_ec.c
src/parser.y

index aca3eadf3aaa72d2c83f89ae616298d67e8da2d7..f4a3070c1c68f992e2e4653ef8685a16cf9f23b9 100644 (file)
@@ -296,7 +296,8 @@ void typecast(node *np)
     if (np->opcode == MESH || np->opcode == ick_ONESPOT || np->opcode == ick_TAIL)
        np->width = 16;
     else if (np->opcode == ick_TWOSPOT || np->opcode == ick_HYBRID
-               || np->opcode == MINGLE || np->opcode == MESH32)
+            || np->opcode == MINGLE || np->opcode == MESH32
+            || np->opcode == UNKNOWNOP /* AIS */)
        np->width = 32;
     else if (np->opcode == AND || np->opcode == OR || np->opcode == XOR ||
             np->opcode == FIN ||
@@ -304,7 +305,7 @@ void typecast(node *np)
        np->width = np->rval->width;
     else if (np->opcode == SELECT)
        np->width = np->rval->width;    /* n-bit select has an n-bit result */
-    else if (np->opcode == UNKNOWNOP || np->opcode == INTERSECTION) /* AIS */
+    else if (np->opcode == INTERSECTION) /* AIS */
         np->width = (np->rval ?
                     np->lval ? np->rval->width == 16 ? np->lval->width : 32 :
                     np->rval->width : np->lval ? np->lval->width : 32);
index 77839cc2d580868281da64a9faee001a8c4acb78..147835439da173d6f6ca7da32ae6ba4c677aab51 100644 (file)
@@ -69,6 +69,7 @@ extern ick_overop* ick_oo_twospots;
                        /*@observer@*/ char* errstr)
 {
   int st;
+  uint32_t rv;
   st = ick_jicmatch(unopstr);
   if(st)
   {
@@ -83,6 +84,7 @@ extern ick_overop* ick_oo_twospots;
     ick_oo_twospots[vi3]=icd[2].accessors;
     ick_global_createdata=icd;
     ick_dogoto(st, emitlineno, 1);
+    rv = og3(ick_twospots[vi3]);
     ick_retrieve(ick_twospots+vi1, ick_TWOSPOT, vi1,
                 ick_twoforget[vi1], ick_oo_twospots);
     ick_retrieve(ick_twospots+vi2, ick_TWOSPOT, vi2,
@@ -92,7 +94,7 @@ extern ick_overop* ick_oo_twospots;
   }
   else
     ick_lose(IE000, emitlineno, errstr);
-  return og3(ick_twospots[vi3]);
+  return rv;
 }
 
 /* Do a NEXT or goto. Gotos don't work with an empty NEXT stack, but that's
index c74c7bd12bec0444e58c87eed85e801b6541f434..901b2bced69ed753581fa147083a072c2ed15a87 100644 (file)
@@ -524,7 +524,7 @@ expr        :   unambig                     {$$ = $1;}
                                          if(!firstslat) firstslat=$1;
                                           else prevslat->nextslat=$1;
                                          $1->nextslat=$3; prevslat=$3;
-                                         $3->nextslat=0;
+                                         $3->nextslat=0; opoverused=1;
                                          intern(ick_TWOSPOT, 1601);
                                          intern(ick_TWOSPOT, 1602);
                                          intern(ick_TWOSPOT, 1603);}}
@@ -549,7 +549,7 @@ notanlvalue:nlunambig                       {$$ = $1;}
                                          if(!firstslat) firstslat=$1;
                                           else prevslat->nextslat=$1;
                                          $1->nextslat=$3; prevslat=$3;
-                                         $3->nextslat=0;
+                                         $3->nextslat=0; opoverused=1;
                                          intern(ick_TWOSPOT, 1601);
                                          intern(ick_TWOSPOT, 1602);
                                          intern(ick_TWOSPOT, 1603);}}
@@ -570,7 +570,7 @@ limexpr :   limunambig                      {$$ = $1;}
                                          if(!firstslat) firstslat=$1;
                                           else prevslat->nextslat=$1;
                                          $1->nextslat=$3; prevslat=$3;
-                                         $3->nextslat=0;
+                                         $3->nextslat=0; opoverused=1;
                                          intern(ick_TWOSPOT, 1601);
                                          intern(ick_TWOSPOT, 1602);
                                          intern(ick_TWOSPOT, 1603);}}