summaryrefslogtreecommitdiff
path: root/core/src
diff options
context:
space:
mode:
authorruki <[email protected]>2026-06-25 23:32:07 +0800
committerGitHub <[email protected]>2026-06-25 23:32:07 +0800
commit9f54e096b92c27f3e382b5450061d0afa1297886 (patch)
tree6258a0f781f4aa4765d7780ee1f62417d110447e /core/src
parentc8eecb9e08362dc1cbd1686a74f23e38c7c21bc4 (diff)
parentd4e1c04ca90958fa0fc618f3660975e1b6a07c8d (diff)
Merge pull request #7620 from xmake-io/vs2015
use vstool.iorunv in has_flags
Diffstat (limited to 'core/src')
-rw-r--r--core/src/xmake/hash/xxhash.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/core/src/xmake/hash/xxhash.c b/core/src/xmake/hash/xxhash.c
index 77bf32dfe..4edcddb59 100644
--- a/core/src/xmake/hash/xxhash.c
+++ b/core/src/xmake/hash/xxhash.c
@@ -138,7 +138,7 @@ tb_int_t xm_hash_xxhash(lua_State *lua) {
}
// compuate hash
- tb_byte_t const *buffer;
+ tb_byte_t const *buffer = tb_null;
tb_uint32_t value32;
XXH64_hash_t value64;
XXH128_hash_t value128;
@@ -154,14 +154,14 @@ tb_int_t xm_hash_xxhash(lua_State *lua) {
buffer = (tb_byte_t const *)&value32;
}
- // make xxhash string
- tb_char_t s[256];
- tb_size_t n = mode >> 3;
- tb_size_t len = xm_hash_make_cstr(s, buffer, n);
+ if (buffer) {
+ tb_char_t s[256];
+ tb_size_t n = mode >> 3;
+ tb_size_t len = xm_hash_make_cstr(s, buffer, n);
- // save result
- lua_pushlstring(lua, s, len);
- ok = tb_true;
+ lua_pushlstring(lua, s, len);
+ ok = tb_true;
+ }
}
// exit stream