/[svn]/linuxsampler/trunk/src/scriptvm/tree.cpp
ViewVC logotype

Diff of /linuxsampler/trunk/src/scriptvm/tree.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3845 by schoenebeck, Tue Jan 5 20:42:32 2021 UTC revision 3846 by schoenebeck, Wed Jan 6 14:01:11 2021 UTC
# Line 696  vmfloat FunctionCall::evalReal() { Line 696  vmfloat FunctionCall::evalReal() {
696      return realExpr->evalReal();      return realExpr->evalReal();
697  }  }
698    
699    vmint FunctionCall::arraySize() const {
700        //FIXME: arraySize() not intended for evaluation semantics (for both
701        // performance reasons with arrays, but also to prevent undesired value
702        // mutation by implied (hidden) evaluation, as actually done here. We must
703        // force function evaluation here though, because we need it for function
704        // calls to be evaluated at all. This issue should be addressed cleanly by
705        // adjusting the API appropriately.
706        FunctionCall* rwSelf = const_cast<FunctionCall*>(this);
707        VMFnResult* result = rwSelf->execVMFn();
708    
709        if (!result) return 0;
710        VMArrayExpr* arrayExpr = dynamic_cast<VMArrayExpr*>(result->resultValue());
711        return arrayExpr->arraySize();
712    }
713    
714  VMIntArrayExpr* FunctionCall::asIntArray() const {  VMIntArrayExpr* FunctionCall::asIntArray() const {
715      //FIXME: asIntArray() not intended for evaluation semantics (for both      //FIXME: asIntArray() not intended for evaluation semantics (for both
716      // performance reasons with arrays, but also to prevent undesired value      // performance reasons with arrays, but also to prevent undesired value

Legend:
Removed from v.3845  
changed lines
  Added in v.3846

  ViewVC Help
Powered by ViewVC