summaryrefslogtreecommitdiff
path: root/src/synthesis.cc
diff options
context:
space:
mode:
authorAdrian Thurston <thurston@colm.net>2018-05-20 13:47:27 -0400
committerAdrian Thurston <thurston@colm.net>2018-05-20 13:47:27 -0400
commitb5e6ba2c784d818c53c2a64af64a466865174c81 (patch)
tree44a377cf5ed066129dee3d8f86c5863ad8a6bb17 /src/synthesis.cc
parent8498ebf5bee1b010dd680da632b0eff66458b494 (diff)
downloadcolm-b5e6ba2c784d818c53c2a64af64a466865174c81.tar.gz
make the rhs of switch vars available in case clauses
Diffstat (limited to 'src/synthesis.cc')
-rw-r--r--src/synthesis.cc5
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