代码拉取完成,页面将自动刷新
同步操作将从 src-anolis-os/luajit 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
commit 362f034c1b91d52ea2cf971314ed4e0c24348bff
Merge: 260b9b4 f5d424a
Author: Mike Pall <mike>
Date: Sun May 20 12:28:10 2018 +0200
Merge branch 'master' into v2.1
From f5d424afe8b9395f0df05aba905e0e1f6a2262b8 Mon Sep 17 00:00:00 2001
From: Mike Pall <mike>
Date: Sun, 20 May 2018 12:25:36 +0200
Subject: [PATCH 39/72] FFI: Make FP to U64 conversions match JIT backend
behavior.
---
src/lj_obj.h | 18 +++++++++++++-----
1 file changed, 13 insertions(+), 5 deletions(-)
diff --git a/src/lj_obj.h b/src/lj_obj.h
index e70b003..2ee526c 100644
--- a/src/lj_obj.h
+++ b/src/lj_obj.h
@@ -816,14 +816,22 @@ static LJ_AINLINE int32_t lj_num2bit(lua_Number n)
#define lj_num2int(n) ((int32_t)(n))
+/*
+** This must match the JIT backend behavior. In particular for archs
+** that don't have a common hardware instruction for this conversion.
+** Note that signed FP to unsigned int conversions have an undefined
+** result and should never be relied upon in portable FFI code.
+** See also: C99 or C11 standard, 6.3.1.4, footnote of (1).
+*/
static LJ_AINLINE uint64_t lj_num2u64(lua_Number n)
{
-#ifdef _MSC_VER
- if (n >= 9223372036854775808.0) /* They think it's a feature. */
- return (uint64_t)(int64_t)(n - 18446744073709551616.0);
- else
+#if LJ_TARGET_X86ORX64 || LJ_TARGET_MIPS
+ int64_t i = (int64_t)n;
+ if (i < 0) i = (int64_t)(n - 18446744073709551616.0);
+ return (uint64_t)i;
+#else
+ return (uint64_t)n;
#endif
- return (uint64_t)n;
}
static LJ_AINLINE int32_t numberVint(cTValue *o)
--
2.20.1
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。