diff options
author | Adrian Thurston <thurston@complang.org> | 2012-08-29 13:25:14 -0400 |
---|---|---|
committer | Adrian Thurston <thurston@complang.org> | 2012-08-29 13:25:14 -0400 |
commit | 0555af659a87fd943fe6b85b27aa787e4d523fdc (patch) | |
tree | 506ec404413daf0fa5091901c1341c502389a4f8 | |
parent | ab40d1b49d9a1631145ff604ad2a65eaa6345dfd (diff) | |
download | colm-0555af659a87fd943fe6b85b27aa787e4d523fdc.tar.gz |
adjusting the nested contiguous stack blocks
-rw-r--r-- | colm/synthesis.cc | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/colm/synthesis.cc b/colm/synthesis.cc index 88bdbee1..c9b0c358 100644 --- a/colm/synthesis.cc +++ b/colm/synthesis.cc @@ -1959,6 +1959,13 @@ void LangVarRef::assignValue( Compiler *pd, CodeVect &code, UniqueType *LangTerm::evaluateMakeToken( Compiler *pd, CodeVect &code ) const { + bool resetContiguous = false; + if ( !pd->inContiguous ) { + code.append( IN_CONTIGUOUS ); + code.appendHalf( 512 ); + pd->inContiguous = true; + resetContiguous = true; + } // if ( pd->compileContext != Compiler::CompileTranslation ) // error(loc) << "make_token can be used only in a translation block" << endp; @@ -1982,6 +1989,9 @@ UniqueType *LangTerm::evaluateMakeToken( Compiler *pd, CodeVect &code ) const code.append( IN_MAKE_TOKEN ); code.append( args->length() ); + if ( resetContiguous ) + pd->inContiguous = false; + return pd->uniqueTypeAny; } @@ -2179,6 +2189,9 @@ void LangStmt::compileForIter( Compiler *pd, CodeVect &code ) const code.appendHalf( searchUT->langEl->id ); } + if ( resetContiguous ) + pd->inContiguous = false; + compileForIterBody( pd, code, iterUT ); iterCallTerm->varRef->popRefQuals( pd, code, lookup, iterCallTerm->args ); @@ -2187,9 +2200,6 @@ void LangStmt::compileForIter( Compiler *pd, CodeVect &code ) const delete[] paramRefs; pd->curLocalFrame->iterPopScope(); - - if ( resetContiguous ) - pd->inContiguous = false; } void LangStmt::compileWhile( Compiler *pd, CodeVect &code ) const |