jitcraft/SemanticAnalysis.cpp
changeset 8 069d207a8f2a
parent 7 0478c27ba82c
child 9 73781c5a59d7
     1.1 --- a/jitcraft/SemanticAnalysis.cpp	Wed Jun 27 22:02:40 2012 -0700
     1.2 +++ b/jitcraft/SemanticAnalysis.cpp	Thu Jun 28 00:26:55 2012 -0700
     1.3 @@ -183,12 +183,12 @@
     1.4              node->setType(left->isFloat() ? left : right);
     1.5              return;
     1.6          }
     1.7 +    }
     1.8  
     1.9 -        // Otherwise, both sides must be integer.
    1.10 -        assert(left->isInt() && right->isInt());
    1.11 -        node->setType(left);
    1.12 -        return;
    1.13 -    }
    1.14 +    // For now, assert everything else is integer and untagged.
    1.15 +    assert(left->isInt() && right->isInt());
    1.16 +    assert(!left->tag() && !right->tag());
    1.17 +    node->setType(left);
    1.18  }
    1.19  
    1.20  void
    1.21 @@ -257,6 +257,9 @@
    1.22  
    1.23              type = Type::NewUnsafeArray(type, size);
    1.24          }
    1.25 +    } else {
    1.26 +        Type *right = visitForLoad(node->initialization());
    1.27 +        assert(TypeCheck(type, right));
    1.28      }
    1.29  
    1.30      node->variable()->setType(type);