diff options
| author | ptitSeb <sebastien.chev@gmail.com> | 2022-06-25 13:54:15 +0200 |
|---|---|---|
| committer | ptitSeb <sebastien.chev@gmail.com> | 2022-06-25 13:54:15 +0200 |
| commit | 4b105066914c14fd4a854c3bea1d4783964f0ef8 (patch) | |
| tree | 7d7c07ff23f944bdec5e1c8ba04e26936189096b /src | |
| parent | 57f1f82d761e38ff1177edb4d7fcb6c86f367cac (diff) | |
| download | box64-4b105066914c14fd4a854c3bea1d4783964f0ef8.tar.gz box64-4b105066914c14fd4a854c3bea1d4783964f0ef8.zip | |
[DYNAREC] Fixed an issue with fillPredecessor that would undersize the predecessor array (should help #328, maybe other)
Diffstat (limited to 'src')
| -rwxr-xr-x | src/dynarec/dynarec_native.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/dynarec/dynarec_native.c b/src/dynarec/dynarec_native.c index 6957ed34..73dc7f65 100755 --- a/src/dynarec/dynarec_native.c +++ b/src/dynarec/dynarec_native.c @@ -285,7 +285,7 @@ int Table64(dynarec_native_t *dyn, uint64_t val) static void fillPredecessors(dynarec_native_t* dyn) { - int pred_sz = 0; + int pred_sz = 1; // to be safe // compute total size of predecessor to alocate the array // first compute the jumps for(int i=0; i<dyn->size; ++i) { @@ -295,8 +295,8 @@ static void fillPredecessors(dynarec_native_t* dyn) } } // second the "has_next" - for(int i=0; i<dyn->size; ++i) { - if(i!=dyn->size-1 && dyn->insts[i].x64.has_next && (!i || dyn->insts[i].pred_sz)) { + for(int i=0; i<dyn->size-1; ++i) { + if(dyn->insts[i].x64.has_next) { ++pred_sz; ++dyn->insts[i+1].pred_sz; } |