There is an Assertion ''JERRY_CONTEXT (jmem_heap_allocated_size) == 0'' failed at /jerry-core/jmem/jmem-heap.c in Jerryscript 3.0.0.
## JerryScript commit hash
55acdf2048b390d0f56f12e64dbfb2559f0e70ad

## Build platform
Ubuntu 20.04 LTS

## Build steps
```
./tools/build.py --clean --debug --compile-flag=-fsanitize=address \
--compile-flag=-m32 --compile-flag=-fno-omit-frame-pointer \
--compile-flag=-fno-common --compile-flag=-g \
--strip=off --system-allocator=on --logging=on \
--linker-flag=-fuse-ld=gold --error-messages=on --line-info=ON \
--stack-limit=10
```

## poc
```
var sab = new SharedArrayBuffer(4);
var a = new Int32Array(sab);
Atomics.add(a, -0, 1);
```

## assert log
```
ICE: Assertion 'JERRY_CONTEXT (jmem_heap_allocated_size) == 0' failed at /home/sakura/jerryscript/jerry-core/jmem/jmem-heap.c(jmem_heap_finalize):108.
Error: ERR_FAILED_INTERNAL_ASSERTION
```
Assertion 'JERRY_CONTEXT (jmem_heap_allocated_size) == 0' failed at /home/sakura/jerryscript/jerry-core/jmem/jmem-heap.c(jmem_heap_finalize):108.
This is a GitHub Issue
repo:jerryscript
owner:jerryscript-project
Title : Assertion 'JERRY_CONTEXT (jmem_heap_allocated_size) == 0' failed at /home/sakura/jerryscript/jerry-core/jmem/jmem-heap.c(jmem_heap_finalize):108.
Issue date:

--- start body ---
## JerryScript commit hash
55acdf2048b390d0f56f12e64dbfb2559f0e70ad

## Build platform
Ubuntu 20.04 LTS

## Build steps
```
./tools/build.py --clean --debug --compile-flag=-fsanitize=address \
--compile-flag=-m32 --compile-flag=-fno-omit-frame-pointer \
--compile-flag=-fno-common --compile-flag=-g \
--strip=off --system-allocator=on --logging=on \
--linker-flag=-fuse-ld=gold --error-messages=on --line-info=ON \
--stack-limit=10
```

## poc
```
var sab = new SharedArrayBuffer(4);
var a = new Int32Array(sab);
Atomics.add(a, -0, 1);
```

## assert log
```
ICE: Assertion 'JERRY_CONTEXT (jmem_heap_allocated_size) == 0' failed at /home/sakura/jerryscript/jerry-core/jmem/jmem-heap.c(jmem_heap_finalize):108.
Error: ERR_FAILED_INTERNAL_ASSERTION
```
--- end body ---

An assertion failure in JerryScript indicates a potential vulnerability related to memory management. The assertion 'JERRY_CONTEXT (jmem_heap_allocated_size) == 0' suggests that the memory heap is not properly cleaned up, which could lead to memory corruption or other undefined behaviors. This issue arises when using SharedArrayBuffer and Atomics, which may be exploited to cause unexpected behavior in the application.