Tarantool development patches archive
 help / color / mirror / Atom feed
* [Tarantool-patches] [PATCH luajit v3 0/3] fix math.min/max inconsistencies
@ 2021-11-11 22:58 Maxim Kokryashkin via Tarantool-patches
  2021-11-11 22:58 ` [Tarantool-patches] [PATCH luajit v3 1/3] Fix math.min()/math.max() inconsistencies Maxim Kokryashkin via Tarantool-patches
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Maxim Kokryashkin via Tarantool-patches @ 2021-11-11 22:58 UTC (permalink / raw)
  To: tarantool-patches, imun, skaplun

math.min()/math.max() could produce different results when compiled.
Previously, these functions did not check for the number of arguments,
which in some situations led to incorrect behavior.

Changes in v2:
- Squashed the commit containing the test with the commit containing the fix
- Added more informative description for the most of the changes

GitHub branch:
https://github.com/tarantool/luajit/tree/fckxorg/gh-6163-min-max

CI:
https://github.com/tarantool/tarantool/tree/fckxorg/gh-6163-min-max

Issue:
https://github.com/tarantool/tarantool/issues/6163

Links to vanilla commits:
- Fix math.min()/math.max() inconsistencies:
  https://github.com/LuaJIT/LuaJIT/commit/03208c8162af9cc01ca76ee1676ca79e5abe9b60
- Don't compile math.modf() anymore.
  https://github.com/LuaJIT/LuaJIT/commit/d75e26275bdcfe95283b761ef9405841ef2d406f
- Cleanup math function compilation and fix inconsistencies.
  https://github.com/LuaJIT/LuaJIT/commit/5655be4546d9177890c69f0d0accac4773ff0887

Still need some comments regarding the last one, more on that in the
part 3.

Mike Pall (3):
  Fix math.min()/math.max() inconsistencies.
  Don't compile math.modf() anymore.
  Cleanup math function compilation and fix inconsistencies.

 src/lib_math.c                                | 24 +++---
 src/lj_asm.c                                  |  6 --
 src/lj_asm_arm.h                              |  7 +-
 src/lj_asm_arm64.h                            |  7 +-
 src/lj_asm_x86.h                              |  2 -
 src/lj_ffrecord.c                             | 35 +--------
 src/lj_ir.h                                   |  4 +-
 src/lj_ircall.h                               | 14 ++--
 src/lj_opt_fold.c                             | 78 ++++++++++---------
 src/lj_opt_split.c                            |  3 -
 src/lj_target_x86.h                           |  6 --
 src/lj_vmmath.c                               | 10 +--
 src/vm_arm.dasc                               |  4 +-
 src/vm_arm64.dasc                             |  4 +-
 src/vm_x64.dasc                               |  2 +-
 src/vm_x86.dasc                               |  2 +-
 .../gh-6163-jit-min-max.test.lua              | 17 ++++
 17 files changed, 98 insertions(+), 127 deletions(-)
 create mode 100644 test/tarantool-tests/gh-6163-jit-min-max.test.lua

--
2.33.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-11-11 23:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-11 22:58 [Tarantool-patches] [PATCH luajit v3 0/3] fix math.min/max inconsistencies Maxim Kokryashkin via Tarantool-patches
2021-11-11 22:58 ` [Tarantool-patches] [PATCH luajit v3 1/3] Fix math.min()/math.max() inconsistencies Maxim Kokryashkin via Tarantool-patches
2021-11-11 22:58 ` [Tarantool-patches] [PATCH luajit v3 2/3] Don't compile math.modf() anymore Maxim Kokryashkin via Tarantool-patches
2021-11-11 22:58 ` [Tarantool-patches] [PATCH luajit v3 3/3] Cleanup math function compilation and fix inconsistencies Maxim Kokryashkin via Tarantool-patches

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox