diff options
| -rw-r--r-- | lcode.c | 8 | ||||
| -rw-r--r-- | makefile | 9 | ||||
| -rwxr-xr-x | manual/2html | 2 |
3 files changed, 12 insertions, 7 deletions
| @@ -663,11 +663,11 @@ static int boolT (FuncState *fs) { | |||
| 663 | ** Add nil to list of constants and return its index. | 663 | ** Add nil to list of constants and return its index. |
| 664 | */ | 664 | */ |
| 665 | static int nilK (FuncState *fs) { | 665 | static int nilK (FuncState *fs) { |
| 666 | TValue k, v; | 666 | lua_State *L = fs->ls->L; |
| 667 | setnilvalue(&v); | 667 | TValue k; |
| 668 | /* cannot use nil as key; instead use table itself */ | 668 | /* cannot use nil as key; instead use table itself */ |
| 669 | sethvalue(fs->ls->L, &k, fs->kcache); | 669 | sethvalue(L, &k, fs->kcache); |
| 670 | return k2proto(fs, &k, &v); | 670 | return k2proto(fs, &k, &G(L)->nilvalue); |
| 671 | } | 671 | } |
| 672 | 672 | ||
| 673 | 673 | ||
| @@ -62,8 +62,11 @@ CWARNS= $(CWARNSCPP) $(CWARNSC) $(CWARNGCC) | |||
| 62 | # ASAN_OPTIONS="detect_invalid_pointer_pairs=2". | 62 | # ASAN_OPTIONS="detect_invalid_pointer_pairs=2". |
| 63 | # -fsanitize=undefined (you may need to add "-lubsan" to libs) | 63 | # -fsanitize=undefined (you may need to add "-lubsan" to libs) |
| 64 | # -fsanitize=pointer-subtract -fsanitize=address -fsanitize=pointer-compare | 64 | # -fsanitize=pointer-subtract -fsanitize=address -fsanitize=pointer-compare |
| 65 | # TESTS= -DLUA_USER_H='"ltests.h"' -Og -g | ||
| 66 | 65 | ||
| 66 | # Test mode: Add test library, turn on asserts, redefine several | ||
| 67 | # constants ("to give some bugs a chance"), track memory use, and add | ||
| 68 | # debug information. | ||
| 69 | # TESTS= -DLUA_USER_H='"ltests.h"' -Og -g | ||
| 67 | 70 | ||
| 68 | LOCAL = $(TESTS) $(CWARNS) | 71 | LOCAL = $(TESTS) $(CWARNS) |
| 69 | 72 | ||
| @@ -71,13 +74,15 @@ LOCAL = $(TESTS) $(CWARNS) | |||
| 71 | # To enable Linux goodies, -DLUA_USE_LINUX | 74 | # To enable Linux goodies, -DLUA_USE_LINUX |
| 72 | # For C89, "-std=c89 -DLUA_USE_C89" | 75 | # For C89, "-std=c89 -DLUA_USE_C89" |
| 73 | # Note that Linux/Posix options are not compatible with C89 | 76 | # Note that Linux/Posix options are not compatible with C89 |
| 77 | # (For 32-bit, add option "-m32" to MYCFLAGS and MYLDFLAGS.) | ||
| 74 | MYCFLAGS= $(LOCAL) -std=c99 -DLUA_USE_LINUX | 78 | MYCFLAGS= $(LOCAL) -std=c99 -DLUA_USE_LINUX |
| 75 | MYLDFLAGS= -Wl,-E | 79 | MYLDFLAGS= -Wl,-E |
| 76 | MYLIBS= -ldl | 80 | MYLIBS= -ldl |
| 77 | 81 | ||
| 78 | 82 | ||
| 79 | CC= gcc | 83 | CC= gcc |
| 80 | CFLAGS= -Wall -O2 $(MYCFLAGS) -fno-stack-protector -fno-common -march=native | 84 | # (Optionally we can use -march=native -mno-avx512f.) |
| 85 | CFLAGS= -Wall -O2 $(MYCFLAGS) -fno-stack-protector -fno-common | ||
| 81 | AR= ar rc | 86 | AR= ar rc |
| 82 | RANLIB= ranlib | 87 | RANLIB= ranlib |
| 83 | RM= rm -f | 88 | RM= rm -f |
diff --git a/manual/2html b/manual/2html index d3b88b34..243f3f22 100755 --- a/manual/2html +++ b/manual/2html | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | #!/usr/bin/env lua5.3 | 1 | #!/usr/bin/env lua |
| 2 | 2 | ||
| 3 | 3 | ||
| 4 | -- special marks: | 4 | -- special marks: |
