aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/source/luxc/lang/translation/r/eval.jvm.lux
diff options
context:
space:
mode:
Diffstat (limited to 'new-luxc/source/luxc/lang/translation/r/eval.jvm.lux')
-rw-r--r--new-luxc/source/luxc/lang/translation/r/eval.jvm.lux13
1 files changed, 9 insertions, 4 deletions
diff --git a/new-luxc/source/luxc/lang/translation/r/eval.jvm.lux b/new-luxc/source/luxc/lang/translation/r/eval.jvm.lux
index c026750a7..5685ae05e 100644
--- a/new-luxc/source/luxc/lang/translation/r/eval.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/r/eval.jvm.lux
@@ -81,7 +81,7 @@
(Long::intValue []))
(: Top
(if (host.instance? Null flag)
- host.null
+ (host.null)
//.unit))
value])))
@@ -90,9 +90,14 @@
(do e.Monad<Error>
[high (ListVector::get-field-sexp [//.int-high-field] host-object)
low (ListVector::get-field-sexp [//.int-low-field] host-object)
- #let [high (:! Nat (IntArrayVector::getElementAsInt [0] (:! IntArrayVector high)))
- low (:! Nat (IntArrayVector::getElementAsInt [0] (:! IntArrayVector low)))]]
- (wrap (|> high (bit.shift-left +32) (n/+ low) nat-to-int))))
+ #let [get-int-32 (|>> (IntArrayVector::getElementAsInt [0]) (:! Nat))
+ high (get-int-32 (:! IntArrayVector high))
+ low (get-int-32 (:! IntArrayVector low))]]
+ (wrap (:! Int
+ (n/+ (|> high (bit.shift-left +32))
+ (if (i/< 0 (:! Int low))
+ (|> low (bit.shift-left +32) (bit.shift-right +32))
+ low))))))
(def: (lux-object host-object)
(-> Object (Error Top))