diff options
author | Adrian Thurston <thurston@colm.net> | 2018-05-20 13:47:27 -0400 |
---|---|---|
committer | Adrian Thurston <thurston@colm.net> | 2018-05-20 13:47:27 -0400 |
commit | b5e6ba2c784d818c53c2a64af64a466865174c81 (patch) | |
tree | 44a377cf5ed066129dee3d8f86c5863ad8a6bb17 /src/synthesis.cc | |
parent | 8498ebf5bee1b010dd680da632b0eff66458b494 (diff) | |
download | colm-b5e6ba2c784d818c53c2a64af64a466865174c81.tar.gz |
make the rhs of switch vars available in case clauses
Diffstat (limited to 'src/synthesis.cc')
-rw-r--r-- | src/synthesis.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/synthesis.cc b/src/synthesis.cc index 5af50863..a45076d9 100644 --- a/src/synthesis.cc +++ b/src/synthesis.cc @@ -674,6 +674,11 @@ void LangVarRef::loadObj( Compiler *pd, CodeVect &code, loadInbuiltObject( pd, code, lastPtrInQual, forWriting ); else if ( isLocalRef() ) loadLocalObj( pd, code, lastPtrInQual, forWriting ); + else if ( isProdRef( pd ) ) { + LangVarRef *dup = new LangVarRef( *this ); + dup->qual->prepend( QualItem( QualItem::Dot, InputLoc(), scope->caseClauseVarRef->name ) ); + dup->loadObj( pd, code, lastPtrInQual, forWriting ); + } else if ( isStructRef() ) loadContextObj( pd, code, lastPtrInQual, forWriting ); else |