projects
/
ulas
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
efaff2f
)
Fixed division in first pass
author
Lukas Krickl
<lukas@krickl.dev>
Tue, 19 Dec 2023 14:24:10 +0000
(15:24 +0100)
committer
Lukas Krickl
<lukas@krickl.dev>
Tue, 19 Dec 2023 14:24:10 +0000
(15:24 +0100)
src/ulas.c
patch
|
blob
|
history
diff --git
a/src/ulas.c
b/src/ulas.c
index e38e47ef940502bac1a6052305b8d74c92f07b31..d69f2e408d221d4eb3f854486538644666c02751 100644
(file)
--- a/
src/ulas.c
+++ b/
src/ulas.c
@@
-1621,6
+1621,9
@@
int ulas_intexpreval(int i, int *rc) {
case '*':
return left * right;
case '/':
+ if (ulas.pass != ULAS_PASS_FINAL) {
+ return 0;
+ }
if (right == 0) {
ULASERR("integer division by 0\n");
*rc = -1;
@@
-1628,6
+1631,9
@@
int ulas_intexpreval(int i, int *rc) {
}
return left / right;
case '%':
+ if (ulas.pass != ULAS_PASS_FINAL) {
+ return 0;
+ }
if (right == 0) {
ULASERR("integer division by 0\n");
*rc = -1;