jitcraft/SemanticAnalysis.cpp
changeset 78 93e0a19c805a
parent 75 662e81d9ed1c
child 79 0206df35882c
     1.1 --- a/jitcraft/SemanticAnalysis.cpp	Tue Jul 17 03:18:32 2012 -0700
     1.2 +++ b/jitcraft/SemanticAnalysis.cpp	Tue Jul 17 03:59:52 2012 -0700
     1.3 @@ -332,6 +332,27 @@
     1.4  }
     1.5  
     1.6  void
     1.7 +SemanticAnalysis::visit(UnaryExpression *node)
     1.8 +{
     1.9 +    Local<Type> type(zone_, visitForLoad(node->expression()));
    1.10 +    if (!type)
    1.11 +        return;
    1.12 +
    1.13 +    switch (node->token())
    1.14 +    {
    1.15 +      default:
    1.16 +        assert(node->token() == TOK_TILDE);
    1.17 +        if (!type->isInt32() || type->tag()) {
    1.18 +            unaryTypeError(node, node->token(), type);
    1.19 +            return;
    1.20 +        }
    1.21 +        
    1.22 +        node->setType(type);
    1.23 +        break;
    1.24 +    }
    1.25 +}
    1.26 +
    1.27 +void
    1.28  SemanticAnalysis::visit(BinaryExpression *node)
    1.29  {
    1.30      Local<Type> left(zone_, visitForLoad(node->left()));