mirror of
https://github.com/NeoFlock/neonucleus.git
synced 2025-09-24 09:03:32 +02:00
Merge branch 'main' of https://github.com/NeoFlock/neonucleus
This commit is contained in:
commit
b9c391f566
@ -134,6 +134,11 @@ void nni_gpu_set(nni_gpu *gpu, void *_, nn_component *component, nn_computer *co
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!nn_unicode_validate(s)) {
|
||||||
|
nn_setCError(computer, "invalid utf-8");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
int current = 0;
|
int current = 0;
|
||||||
while(s[current]) {
|
while(s[current]) {
|
||||||
int codepoint = nn_unicode_codepointAt(s, current);
|
int codepoint = nn_unicode_codepointAt(s, current);
|
||||||
@ -294,6 +299,10 @@ void nni_gpu_fill(nni_gpu *gpu, void *_, nn_component *component, nn_computer *c
|
|||||||
nn_setCError(computer, "bad argument #5 (character expected)");
|
nn_setCError(computer, "bad argument #5 (character expected)");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if(!nn_unicode_validate(s)) {
|
||||||
|
nn_setCError(computer, "invalid utf-8");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
int codepoint = nn_unicode_codepointAt(s, 0);
|
int codepoint = nn_unicode_codepointAt(s, 0);
|
||||||
|
|
||||||
|
@ -483,6 +483,7 @@ int testLuaArch_unicode_char(lua_State *L) {
|
|||||||
if(!lua_isinteger(L, idx)) {
|
if(!lua_isinteger(L, idx)) {
|
||||||
nn_free(codepoints);
|
nn_free(codepoints);
|
||||||
luaL_argerror(L, idx, "integer expected");
|
luaL_argerror(L, idx, "integer expected");
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
codepoints[i] = lua_tointeger(L, idx);
|
codepoints[i] = lua_tointeger(L, idx);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user