Skip to content

Commit a22a5da

Browse files
authored
Correct RIOT os_mmap size type to size_t (#1002)
Change signature of riot `os_mmap` implementation to match declaration in core/shared/platform/include/platform_api_vmcore.h
1 parent 4bdeb90 commit a22a5da

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

core/shared/platform/riot/riot_platform.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,11 @@ os_free(void *ptr)
4444
}
4545

4646
void *
47-
os_mmap(void *hint, unsigned int size, int prot, int flags)
47+
os_mmap(void *hint, size_t size, int prot, int flags)
4848
{
49-
return BH_MALLOC(size);
49+
if (size > ((unsigned)~0))
50+
return NULL;
51+
return BH_MALLOC((unsigned)size);
5052
}
5153

5254
void

0 commit comments

Comments
 (0)