jitcraft/API.cpp
changeset 72 40746ab0a30b
parent 70 1aec996cde2d
child 84 eaa43f765cbd
     1.1 --- a/jitcraft/API.cpp	Sat Jul 14 18:43:34 2012 -0700
     1.2 +++ b/jitcraft/API.cpp	Sat Jul 14 21:01:52 2012 -0700
     1.3 @@ -366,7 +366,8 @@
     1.4      }
     1.5  
     1.6      // Functions can only return tagged cells, for ISPE1-compatible Invoke().
     1.7 -    if (!fun->type()->returnType()->isPrimitive() || fun->type()->returnType()->isTraceable())
     1.8 +    ke::Local<ke::Type> returnType(ke::ZONE(), fun->type()->returnType());
     1.9 +    if ((!returnType->isPrimitive() && !returnType->isVoid()) || returnType->isTraceable())
    1.10          return false;
    1.11  
    1.12      return true;
    1.13 @@ -464,6 +465,9 @@
    1.14      if (!Interpret(ke::ZONE(), NULL, &result))
    1.15          return false;
    1.16  
    1.17 +    if (fun->type()->returnType()->isVoid())
    1.18 +        result.i32 = 0;
    1.19 +
    1.20      *retval = result.i32;
    1.21      return true;
    1.22  }