Skip to content

Commit

Permalink
IARV64 results need to be checked for 0x7FFFF000
Browse files Browse the repository at this point in the history
When MEMLIMIT is reached, IARV64 GETSTOR returns 0x7FFFF000; this
conditions needs to be checked before memsetting.

Fixes: #474

Signed-off-by: Irek Fakhrutdinov <[email protected]>
  • Loading branch information
ifakhrutdinov committed Aug 30, 2024
1 parent 380dfaf commit c0cf078
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## `3.0.0`
- Add support for LE 64-bit in isgenq.c (#422).
- Bugfix: IARV64 results must be checked for 0x7FFFF000 (#474)

## `2.17.0`
- Fixed `xplatform.loadFileUTF8` when trying to open nonexistent file (#454)
Expand Down
14 changes: 12 additions & 2 deletions c/alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,12 @@ static char* __ptr64 getmain64(long long sizeInMegabytes, int *returnCode, int *

if (returnCode) *returnCode = macroRetCode;
if (reasonCode) *reasonCode = macroResCode;


// IARV64 returns 0x7FFFF000 when MEMLIMIT is reached
if (data == (void *)0x7FFFF000) {
data = NULL;
}

return data;

}
Expand All @@ -202,7 +207,12 @@ static char* __ptr64 getmain64ByToken(long long sizeInMegabytes, long long token

if (returnCode) *returnCode = macroRetCode;
if (reasonCode) *reasonCode = macroResCode;


// IARV64 returns 0x7FFFF000 when MEMLIMIT is reached
if (data == (void *)0x7FFFF000) {
data = NULL;
}

return data;

}
Expand Down

0 comments on commit c0cf078

Please sign in to comment.