summary refs log tree commit diff
path: root/parse.c
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2021-09-14 13:49:26 -0700
committerQuentin Carbonneaux <quentin@c9x.me>2021-09-20 09:10:10 +0200
commitbb16529b34a844c6e15f8837950585761122106e (patch)
treef676f1e5c327b52296510b9cd2bd0f20212363a3 /parse.c
parent52c8eb48ee86c8fd0e44570c31c7de28dea63cf3 (diff)
downloadroux-bb16529b34a844c6e15f8837950585761122106e.tar.gz
parse: fix loadw when assigned to l temporary
The documentation states that loadw is syntactic sugar for loadsw,
but it actually got parsed as Oload. If the result is an l temporary,
Oload behaves like Oloadl, not Oloadsw.

To fix this, parse Tloadw as Oloadsw explicitly.
Diffstat (limited to 'parse.c')
-rw-r--r--parse.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/parse.c b/parse.c
index 43ae23b..da88f58 100644
--- a/parse.c
+++ b/parse.c
@@ -633,7 +633,9 @@ DoOp:
 			arg[1] = R;
 		goto Ins;
 	}
-	if (op >= Tloadw && op <= Tloadd)
+	if (op == Tloadw)
+		op = Oloadsw;
+	if (op >= Tloadl && op <= Tloadd)
 		op = Oload;
 	if (op == Talloc1 || op == Talloc2)
 		op = Oalloc;