| 5885 | } |
| 5886 | |
| 5887 | void asCCompiler::CompileExpressionStatement(asCScriptNode *enode, asCByteCode *bc) |
| 5888 | { |
| 5889 | if( enode->firstChild ) |
| 5890 | { |
| 5891 | // Compile the expression |
| 5892 | asCExprContext expr(engine); |
| 5893 | CompileAssignment(enode->firstChild, &expr); |
| 5894 | |
| 5895 | // Must not have unused ambiguous names |
| 5896 | if( expr.IsClassMethod() || expr.IsGlobalFunc() ) |
| 5897 | Error(TXT_INVALID_EXPRESSION_AMBIGUOUS_NAME, enode); |
| 5898 | |
| 5899 | // Must not have unused anonymous functions |
| 5900 | if( expr.IsLambda() ) |
| 5901 | Error(TXT_INVALID_EXPRESSION_LAMBDA, enode); |
| 5902 | |
| 5903 | // If we get here and there is still an unprocessed property |
| 5904 | // accessor, then process it as a get access. Don't call if there is |
| 5905 | // already a compile error, or we might report an error that is not valid |
| 5906 | if( !hasCompileErrors ) |
| 5907 | if( ProcessPropertyGetAccessor(&expr, enode) < 0 ) |
| 5908 | return; |
| 5909 | |
| 5910 | // Pop the value from the stack |
| 5911 | if( !expr.type.dataType.IsPrimitive() ) |
| 5912 | expr.bc.Instr(asBC_PopPtr); |
| 5913 | |
| 5914 | // Release temporary variables used by expression |
| 5915 | ReleaseTemporaryVariable(expr.type, &expr.bc); |
| 5916 | |
| 5917 | ProcessDeferredParams(&expr); |
| 5918 | |
| 5919 | expr.bc.OptimizeLocally(tempVariableOffsets); |
| 5920 | bc->AddCode(&expr.bc); |
| 5921 | } |
| 5922 | } |
| 5923 | |
| 5924 | void asCCompiler::PrepareTemporaryVariable(asCScriptNode *node, asCExprContext *ctx, bool forceOnHeap) |
| 5925 | { |
nothing calls this directly
no test coverage detected