]> gitweb.factorcode.org Git - factor.git/commitdiff
cast fixes undefined behaviour; closes #1919 in upstream
authorCat Stevens <catb0t@protonmail.ch>
Sat, 27 Jan 2018 18:05:07 +0000 (13:05 -0500)
committerBjörn Lindqvist <bjourne@gmail.com>
Wed, 31 Jan 2018 16:15:54 +0000 (17:15 +0100)
vm/layouts.hpp

index 7975f4ca92c1c5c8a8257e40d96d0102cb1e1de8..e60201ed5dd7a9b3f98fbaf73d6daead50231c44 100644 (file)
@@ -104,7 +104,7 @@ inline static fixnum untag_fixnum(cell tagged) {
 }
 
 inline static cell tag_fixnum(fixnum untagged) {
-  return (untagged << TAG_BITS) | FIXNUM_TYPE;
+  return ( (cell)untagged << TAG_BITS) | FIXNUM_TYPE;
 }
 
 #define NO_TYPE_CHECK static const cell type_number = TYPE_COUNT