make std/string test ok again

This commit is contained in:
dcode
2019-03-16 14:48:22 +01:00
parent 05a35f42f6
commit 0c388ca4c6
9 changed files with 3929 additions and 4779 deletions

View File

@ -192,7 +192,7 @@ function assertUnregistered(ref: usize): void {
/** Asserts that a managed object has already been registered. */
// @ts-ignore: decorator
function assertRegistered(ref: usize): void {
assert(ref > HEAP_BASE); // must be a heap object
// may be a static string or buffer (not a heap object)
assert(changetype<HEADER>(ref - HEADER_SIZE).classId != HEADER_MAGIC);
}