aboutsummaryrefslogtreecommitdiff
path: root/src/main/stanza/passes.stanza
diff options
context:
space:
mode:
authorazidar2015-04-23 22:42:32 -0700
committerazidar2015-04-23 22:42:32 -0700
commit6add45d9bb45a179cb7b81f0b4fc3e201019f9cc (patch)
tree385b696d5104bceb0c9577b26d1b07f88ac5c87b /src/main/stanza/passes.stanza
parent0224127dc4dba9cf35b0208d32a116b7d33ad925 (diff)
Fixed bug in lowering where the arguments to DoPrim and Pad weren't lowered
Diffstat (limited to 'src/main/stanza/passes.stanza')
-rw-r--r--src/main/stanza/passes.stanza6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/main/stanza/passes.stanza b/src/main/stanza/passes.stanza
index 50d2831a..6c347dff 100644
--- a/src/main/stanza/passes.stanza
+++ b/src/main/stanza/passes.stanza
@@ -789,6 +789,12 @@ defn lower (body:Stmt, table:HashTable<Symbol,List<KeyValue<Expression,Flip>>>)
val exps = expand-expr(exp(e))
val len = num-elems(type(e))
headn(tailn(exps,len * value(e)),len)
+ (e:Pad) :
+ val v = key(expand-expr(value(e))[0])
+ list(KeyValue(Pad(v,width(e),type(e)),DEFAULT))
+ (e:DoPrim) :
+ val args = for x in args(e) map : key(expand-expr(x)[0])
+ list(KeyValue(DoPrim(op(e),args,consts(e),type(e)),DEFAULT))
(e) : list(KeyValue(e, DEFAULT))
;println-debug(table)