diff options
author | Mike Pall <mike> | 2024-05-25 16:38:05 +0200 |
---|---|---|
committer | Mike Pall <mike> | 2024-05-25 16:38:05 +0200 |
commit | 4a22050df9e76a28ef904382e4b4c69578973cd5 (patch) | |
tree | 5554c38a7471e56ef192d0373b05e64e8eb70664 | |
parent | 9b5e837ac2dfdc0638830c048a47ca9378c504d3 (diff) | |
download | luajit-4a22050df9e76a28ef904382e4b4c69578973cd5.tar.gz luajit-4a22050df9e76a28ef904382e4b4c69578973cd5.tar.bz2 luajit-4a22050df9e76a28ef904382e4b4c69578973cd5.zip |
Prevent sanitizer warning in snap_restoredata().
Thanks to Sergey Kaplun. #1193
-rw-r--r-- | src/lj_snap.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lj_snap.c b/src/lj_snap.c index 4a773048..9858c110 100644 --- a/src/lj_snap.c +++ b/src/lj_snap.c | |||
@@ -731,7 +731,6 @@ static void snap_restoredata(GCtrace *T, ExitState *ex, | |||
731 | *(lua_Number *)dst = (lua_Number)*(int32_t *)dst; | 731 | *(lua_Number *)dst = (lua_Number)*(int32_t *)dst; |
732 | return; | 732 | return; |
733 | } | 733 | } |
734 | src = (int32_t *)&ex->gpr[r-RID_MIN_GPR]; | ||
735 | #if !LJ_SOFTFP | 734 | #if !LJ_SOFTFP |
736 | if (r >= RID_MAX_GPR) { | 735 | if (r >= RID_MAX_GPR) { |
737 | src = (int32_t *)&ex->fpr[r-RID_MIN_FPR]; | 736 | src = (int32_t *)&ex->fpr[r-RID_MIN_FPR]; |
@@ -743,8 +742,11 @@ static void snap_restoredata(GCtrace *T, ExitState *ex, | |||
743 | #else | 742 | #else |
744 | if (LJ_BE && sz == 4) src++; | 743 | if (LJ_BE && sz == 4) src++; |
745 | #endif | 744 | #endif |
746 | } | 745 | } else |
747 | #endif | 746 | #endif |
747 | { | ||
748 | src = (int32_t *)&ex->gpr[r-RID_MIN_GPR]; | ||
749 | } | ||
748 | } | 750 | } |
749 | } | 751 | } |
750 | lua_assert(sz == 1 || sz == 2 || sz == 4 || sz == 8); | 752 | lua_assert(sz == 1 || sz == 2 || sz == 4 || sz == 8); |