mirror of
https://github.com/NeoFlock/neonucleus.git
synced 2025-09-24 17:13:31 +02:00
fixed some optimizer UB
This commit is contained in:
parent
5c07affec0
commit
569315a23c
@ -3,13 +3,14 @@
|
|||||||
#include <lauxlib.h>
|
#include <lauxlib.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <math.h>
|
|
||||||
#include "neonucleus.h"
|
#include "neonucleus.h"
|
||||||
|
|
||||||
char *testLuaSandbox = NULL;
|
char *testLuaSandbox = NULL;
|
||||||
|
|
||||||
#if LUA_VERSION_NUM == 502
|
#if LUA_VERSION_NUM == 502
|
||||||
|
|
||||||
|
#include <math.h>
|
||||||
|
|
||||||
// monkey patching
|
// monkey patching
|
||||||
|
|
||||||
bool lua_isinteger(lua_State *L, int i) {
|
bool lua_isinteger(lua_State *L, int i) {
|
||||||
@ -505,7 +506,7 @@ int testLuaArch_unicode_sub(lua_State *L) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
char *sub = nn_unicode_char(points + start - 1, stop - start + 1);
|
char *sub = nn_unicode_char(points + start - 1, stop - start + 1);
|
||||||
char *res = testLuaArch_pushstring(L, sub);
|
const char *res = testLuaArch_pushstring(L, sub);
|
||||||
nn_free(sub);
|
nn_free(sub);
|
||||||
nn_free(points);
|
nn_free(points);
|
||||||
if (!res) {
|
if (!res) {
|
||||||
@ -531,7 +532,7 @@ int testLuaArch_unicode_char(lua_State *L) {
|
|||||||
codepoints[i] = lua_tointeger(L, idx);
|
codepoints[i] = lua_tointeger(L, idx);
|
||||||
}
|
}
|
||||||
char *s = nn_unicode_char(codepoints, argc);
|
char *s = nn_unicode_char(codepoints, argc);
|
||||||
char *res = testLuaArch_pushstring(L, s);
|
const char *res = testLuaArch_pushstring(L, s);
|
||||||
nn_free(s);
|
nn_free(s);
|
||||||
nn_free(codepoints);
|
nn_free(codepoints);
|
||||||
if (!res) {
|
if (!res) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user