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 |