Mike Pall
04dca7911e
Call math.randomseed() without arguments to seed from system entropy.
...
Reminder: the math.random() PRNG is NOT SUITABLE FOR CRYPTOGRAPHIC USE.
2024-07-04 01:26:29 +02:00
Mike Pall
7421a1b33c
Restore state when recording __concat metamethod throws an error.
...
Thanks to Sergey Kaplun. #1234
2024-07-04 00:48:49 +02:00
Mike Pall
510f88d468
Add build flag LUAJIT_DISABLE_TAILCALL to disable tailcall generation.
...
Only use this for debugging purposes. NEVER set it for regular builds
or distro builds! In Lua, tailcalls are a language guarantee.
Suggested by Steve Vermeulen. #1220
2024-07-04 00:13:58 +02:00
Mike Pall
444c8ff19a
Clarify that lj_buf_shrink() does not keep any buffer data.
...
https://www.freelists.org/post/luajit/lj-buf-shrink-may-truncate-the-data-and-sbw-point-over-the-end-of-the-buffer,1
Thanks to Junlong li.
2024-07-04 00:03:40 +02:00
Mike Pall
8038430110
Merge branch 'master' into v2.1
2024-07-03 23:59:03 +02:00
Mike Pall
7a608e4425
FFI: Fix various issues in recff_cdata_arith.
...
Thanks to Sergey Kaplun. #1224
2024-07-03 23:46:47 +02:00
Mike Pall
f602f0154b
Fix predict_next() in parser (for real now).
...
Reported by Sergey Kaplun. #1226 #1054
2024-07-03 23:45:16 +02:00
Mike Pall
f2a1cd4328
FFI: Fix __tostring metamethod access to enum cdata value.
...
Thanks to Sergey Kaplun. #1232
2024-07-03 23:43:57 +02:00
Mike Pall
0f8b878e2f
Fix typo.
...
Reported by Sergey Bronnikov. #1223
2024-07-03 23:43:29 +02:00
Mike Pall
6885efb73e
Merge branch 'master' into v2.1
2024-07-03 23:42:38 +02:00
Mike Pall
811c5322c8
Handle partial snapshot restore due to stack overflow.
...
Reported by pwnhacker0x18. Fixed by Peter Cawley. #1196
2024-07-03 21:42:21 +02:00
Mike Pall
93e87998b2
Update Nintendo Switch build script.
...
Thanks to IoriBranford. #1214
2024-05-25 19:01:18 +02:00
Mike Pall
f5587f5eb3
Merge branch 'master' into v2.1
2024-05-25 16:41:53 +02:00
Mike Pall
4a22050df9
Prevent sanitizer warning in snap_restoredata().
...
Thanks to Sergey Kaplun. #1193
2024-05-25 16:38:05 +02:00
Mike Pall
80c1c65bce
Typo.
2024-05-25 16:25:35 +02:00
Mike Pall
4fc48c50fe
Limit number of string format elements to compile.
...
Reported by pwnhacker0x18. #1203
2024-05-25 16:22:39 +02:00
Mike Pall
5790d25397
OSX/iOS: Fix SDK incompatibility.
...
Thanks to Ryan Carsten Schmidt. #1189
2024-04-22 10:06:42 +02:00
Mike Pall
b3e4987389
Windows/MSVC: Cleanup msvcbuild.bat and always generate PDB.
...
Thanks to Miku AuahDark. #1127
2024-04-19 11:01:13 +02:00
Mike Pall
75e9277798
Merge branch 'master' into v2.1
2024-04-19 01:47:48 +02:00
Mike Pall
9b5e837ac2
Fix segment release check in internal memory allocator.
...
Thanks to Jinji Zeng. #1179 #1157
2024-04-19 01:44:19 +02:00
Mike Pall
d032c637b1
Fix compiler warning.
2024-04-19 01:41:12 +02:00
Mike Pall
f5affaa6c4
FFI: Turn FFI finalizer table into a proper GC root.
...
Reported by Sergey Bronnikov. #1168
2024-04-19 01:33:19 +02:00
Mike Pall
7110b93567
OSX/iOS: Always generate 64 bit non-FAT Mach-O object files.
...
Reported by Sergey Bronnikov. #1181
2024-04-19 00:31:06 +02:00
Mike Pall
d2fe2a6d46
Show name of NYI bytecode in -jv and -jdump.
...
Suggested by Sergey Kaplun. #1176 #567
2024-04-19 00:12:22 +02:00
Mike Pall
b8b49bf395
Use generic trace error for OOM during trace stitching.
...
Thanks to Sergey Kaplun. #1166
2024-04-18 23:57:53 +02:00
Mike Pall
d06beb0480
Handle all types of errors during trace stitching.
...
Thanks to Sergey Kaplun and Peter Cawley. #1166 #720
2024-03-10 17:29:48 +01:00
Mike Pall
bcc5125a91
Fix recording of __concat metamethod.
...
Thanks to Sergey Kaplun. #1164
2024-03-10 17:26:36 +01:00
Mike Pall
913df6a945
Merge branch 'master' into v2.1
2024-03-10 17:26:03 +01:00
Mike Pall
cae361187e
Prevent down-recursion for side traces.
...
Thanks to Sergey Kaplun. #1169
2024-03-10 17:23:21 +01:00
Mike Pall
302366a338
Check frame size limit before returning to a lower frame.
...
Thanks to Sergey Kaplun. #1173
2024-03-10 17:19:29 +01:00
Mike Pall
dda1ac273a
FFI: Treat cdata finalizer table as a GC root.
...
Thanks to Sergey Bronnikov. #1168
2024-03-10 17:16:41 +01:00
Mike Pall
88ed9fdbbb
Handle stack reallocation in debug.setmetatable() and lua_setmetatable().
...
Thanks to Sergey Kaplun. #1172
2024-03-10 17:13:28 +01:00
Mike Pall
0d313b2431
Merge branch 'master' into v2.1
2024-02-04 16:47:14 +01:00
Mike Pall
defe61a567
Rework stack overflow handling.
...
Reported by pwnhacker0x18. Fixed by Peter Cawley. #1152
2024-02-04 16:34:30 +01:00
Mike Pall
9cc2e42b17
Merge branch 'master' into v2.1
2024-01-31 14:39:50 +01:00
Mike Pall
9cdd5a9479
Preserve keys with dynamic values in template tables when saving bytecode.
...
Reported by Lyrthras. Fixed by Peter Cawley. #1155
2024-01-31 14:32:04 +01:00
Mike Pall
5e5d542c99
Merge branch 'master' into v2.1
2024-01-31 14:31:40 +01:00
Mike Pall
14987af80a
Prevent include of luajit_rolling.h.
...
Thanks to Peter Cawley. #1145
2024-01-31 14:29:23 +01:00
Mike Pall
343ce0edaf
Fix zero stripping in %g number formatting.
...
Reported by pwnhacker0x18. #1149
2024-01-25 13:23:48 +01:00
Mike Pall
f2336c48fa
Merge branch 'master' into v2.1
2024-01-23 19:01:46 +01:00
Mike Pall
85b4fed0b0
Fix unsinking of IR_FSTORE for NULL metatable.
...
Reported by pwnhacker0x18. #1147
2024-01-23 18:58:52 +01:00
Mike Pall
2f35cb45fd
MIPS64 R2/R6: Fix FP to integer conversions.
...
Thanks to Peter Cawley. #1146
2024-01-22 19:12:13 +01:00
Mike Pall
4b90f6c4d7
Add cross-32/64 bit and deterministic bytecode generation.
...
Contributed by Peter Cawley. #993 #1008
2024-01-22 19:06:36 +01:00
Mike Pall
dbd363ca25
Merge branch 'master' into v2.1
2023-12-23 19:49:43 +01:00
Mike Pall
658530562c
Check for IR_HREF vs. IR_HREFK aliasing in non-nil store check.
...
Thanks to Peter Cawley. #1133
2023-12-23 19:43:03 +01:00
Mike Pall
293199c5eb
Merge branch 'master' into v2.1
2023-12-23 19:23:12 +01:00
Mike Pall
7dbe545933
Respect jit.off() on pending trace exit.
...
Thanks to Sergey Kaplun. #1134
2023-12-23 19:22:34 +01:00
Mike Pall
e02a207909
Merge branch 'master' into v2.1
2023-12-23 19:15:57 +01:00
Mike Pall
c42c62e71a
Simplify handling of instable types in TNEW/TDUP load forwarding.
...
Thanks to Peter Cawley. #994
2023-12-23 19:14:32 +01:00
Mike Pall
29b0b282f5
Merge branch 'master' into v2.1
2023-12-11 13:04:43 +01:00
Mike Pall
9bdfd34dcc
Only emit proper parent references in snapshot replay.
...
Thanks to Peter Cawley. #1132
2023-12-11 13:01:36 +01:00
Mike Pall
ff204d0350
Fix anchoring for string buffer set() method (again).
...
Thanks to Peter Cawley. #1125
2023-12-10 19:42:22 +01:00
Mike Pall
8d5ea4ceb9
Merge branch 'master' into v2.1
2023-12-10 16:13:34 +01:00
Mike Pall
10cc759f25
ARM: Fix stack restore for FP slots.
...
Thanks to Peter Cawley. #1131
2023-12-10 16:10:48 +01:00
Mike Pall
e02cb19b57
Fix anchoring for string buffer set() method.
...
Thanks to Peter Cawley. #1125
2023-12-10 15:33:47 +01:00
Mike Pall
e4168fae5b
Merge branch 'master' into v2.1
2023-12-10 15:02:26 +01:00
Mike Pall
856423f5da
Fix runtime library flags for MSVC debug builds.
...
Reported by igor725. #1127
2023-12-10 15:00:52 +01:00
Mike Pall
487eaaf040
Merge branch 'master' into v2.1
2023-12-10 14:50:29 +01:00
Mike Pall
dcf3627d79
Fix .debug_abbrev section in GDB JIT API.
...
Thanks to Dmitry Stogov. #1129
2023-12-10 14:48:34 +01:00
Mike Pall
d1236a4caa
Optimize table.new() with constant args to (sinkable) IR_TNEW.
...
Thanks to Peter Cawley. #1128
2023-12-10 14:41:56 +01:00
Mike Pall
7ad68a1fd3
Merge branch 'master' into v2.1
2023-12-10 14:33:48 +01:00
Mike Pall
1761fd2ef7
Emit sunk IR_NEWREF only once per key on snapshot replay.
...
Thanks to Sergey Kaplun and Peter Cawley. #1128
2023-12-10 14:29:45 +01:00
Mike Pall
43d0a19158
Fix last commit.
2023-11-15 01:41:31 +01:00
Mike Pall
536cf8a271
Merge branch 'master' into v2.1
2023-11-14 22:56:09 +01:00
Mike Pall
644723649e
x86/x64: Don't fuse loads across IR_NEWREF.
...
Reported by Peter Cawley. #1117
2023-11-14 22:50:21 +01:00
Mike Pall
113a168b79
Improve last commit.
2023-11-12 16:11:11 +01:00
Mike Pall
45c88b7963
x86/x64: Don't fuse loads across table.clear.
...
Reported by Peter Cawley. #1117
2023-11-12 15:41:52 +01:00
Mike Pall
6807e60af1
Merge branch 'master' into v2.1
2023-11-12 15:25:14 +01:00
Mike Pall
d854d00ce9
x86/x64: Add more red zone checks to assembler backend.
...
Thanks to Peter Cawley. #1116
2023-11-12 15:18:44 +01:00
Mike Pall
7c9671a043
Merge branch 'master' into v2.1
2023-11-12 15:11:29 +01:00
Mike Pall
a4c1640432
Add stack check to pcall/xpcall.
...
Analyzed by Peter Cawley. #1048
2023-11-12 14:42:24 +01:00
Mike Pall
69bbbf7736
Merge branch 'master' into v2.1
2023-11-09 11:05:27 +01:00
Mike Pall
65c8493907
Invalidate SCEV entry when returning to lower frame.
...
Thanks to Zhongwei Yao. #1115
2023-11-09 11:02:36 +01:00
Mike Pall
b94fbfbee9
Merge branch 'master' into v2.1
2023-11-07 22:28:53 +01:00
Mike Pall
433d7e8d8d
FFI: Fix pragma push stack limit check and throw on overflow.
...
Reported by Sergey Kaplun. #1114
2023-11-07 22:25:42 +01:00
Mike Pall
ce2cd61739
ARM64: Fix disassembly of ldp/stp offsets.
...
Thanks to Peter Cawley. #1113
2023-11-06 23:14:22 +01:00
Mike Pall
07b3cd3cf9
Check for upvalue state transition in IR_UREFO.
...
Thanks to Peter Cawley. #1085
2023-11-05 16:34:46 +01:00
Mike Pall
0afa1676b2
Merge branch 'master' into v2.1
2023-11-05 11:37:57 +01:00
Mike Pall
d133d67c88
x64: Properly fix __call metamethod return dispatch.
...
Reported by Sergey Kaplun. #1110
2023-11-05 11:31:08 +01:00
Mike Pall
f2e955dae8
Windows/x86: _BitScan*64 are only available on 64 bit archs.
...
Reported by memcorrupt. #1109
2023-11-05 11:27:35 +01:00
Mike Pall
e826d0c101
Add 'cc' file type for saving bytecode.
...
Contributed by Sergey Bronnikov. #1105
2023-10-21 13:31:45 +02:00
Mike Pall
4eb47df605
FFI/Windows: Fix type declaration for int64_t and uint64_t.
...
Thanks to Peter Cawley. #1106
2023-10-21 13:18:51 +02:00
Mike Pall
7269b02130
Merge branch 'master' into v2.1
2023-10-21 13:13:34 +02:00
Mike Pall
db944b2b56
FFI: Fix dangling reference to CType in carith_checkarg().
...
Reported by Sergey Kaplun. #1108
2023-10-21 13:11:50 +02:00
Mike Pall
d2a5487fd7
ARM64: Use ADR and ADRP to form constants.
...
Thanks to Peter Cawley. #1100
2023-10-08 22:10:02 +02:00
Mike Pall
14866a6828
ARM64: Fix disassembly of U12 loads.
...
Thanks to Peter Cawley. #1100
2023-10-08 21:57:04 +02:00
Mike Pall
c5b075eb31
ARM64: Unify constant register handling in interpreter.
...
Plus minor optimizations. Simplifications for out-of-tree ARM64EC.
Thanks to Peter Cawley. #1096
2023-10-08 21:39:40 +02:00
Mike Pall
9cc8bbb7ae
ARM: Fix register hint for FFI calls with FP results.
2023-10-08 21:22:50 +02:00
Mike Pall
1e93951b25
ARM64: Fix register hint for FFI calls with FP results.
...
Thanks to Peter Cawley. #1096
2023-10-08 21:20:10 +02:00
Mike Pall
007e4dce13
ARM64: Restore fp before sp in C stack unwinders.
...
Thanks to Peter Cawley. #1096
2023-10-08 21:17:43 +02:00
Mike Pall
becf5cc65d
FFI: Fix ffi.abi("pauth").
...
Thanks to Peter Cawley. #1098
2023-09-25 16:56:17 +02:00
Mike Pall
97c75843c6
Merge branch 'master' into v2.1
2023-09-22 21:07:20 +02:00
Mike Pall
f72c19e482
Maintain chain invariant in DCE.
...
Thanks to Peter Cawley. #1094
2023-09-22 21:04:22 +02:00
Mike Pall
d1a2fef8a8
LJ_FR2: Fix stack checks in vararg calls.
...
Thanks to Peter Cawley. #1048
2023-09-21 05:19:55 +02:00
Mike Pall
234dbc481e
Merge branch 'master' into v2.1
2023-09-21 04:44:37 +02:00
Mike Pall
aa6b15c1a8
Follow-up fix for stack overflow handling cleanup.
2023-09-21 04:43:40 +02:00
Mike Pall
a5d2f70c73
Handle OOM error on stack resize in coroutine.resume and lua_checkstack.
...
Thanks to Peter Cawley. #1066
2023-09-21 04:40:48 +02:00
Mike Pall
e86990f7f2
Restore cur_L for specific Lua/C API use case.
...
Thanks to Peter Cawley. #1066
2023-09-21 03:54:08 +02:00
Mike Pall
b8919781d4
Consistently use 64 bit constants for 64 bit IR instructions.
...
Thanks to Peter Cawley. #1084
2023-09-21 03:46:33 +02:00
Mike Pall
9159289927
ARM64: Fix IR_HREF code generation for constant FP keys.
...
Reported by swarn. Fix for 435d8c63
by Peter Cawley. #1090
2023-09-21 02:48:12 +02:00