add some text to safe heap asserts

This commit is contained in:
Alon Zakai 2014-03-09 18:10:24 -07:00
Родитель d8423a643c
Коммит 86587901bb
1 изменённых файлов: 4 добавлений и 4 удалений

Просмотреть файл

@ -187,16 +187,16 @@ function SAFE_HEAP_STORE(dest, value, bytes, isFloat) {
Module.print('SAFE_HEAP store: ' + [dest, value, bytes, isFloat]); Module.print('SAFE_HEAP store: ' + [dest, value, bytes, isFloat]);
#endif #endif
assert(dest > 0, 'segmentation fault'); assert(dest > 0, 'segmentation fault');
assert(dest % bytes === 0); assert(dest % bytes === 0, 'alignment error');
assert(dest < Math.max(DYNAMICTOP, STATICTOP)); assert(dest < Math.max(DYNAMICTOP, STATICTOP), 'segmentation fault (high)');
assert(DYNAMICTOP <= TOTAL_MEMORY); assert(DYNAMICTOP <= TOTAL_MEMORY);
setValue(dest, value, getSafeHeapType(bytes, isFloat), 1); setValue(dest, value, getSafeHeapType(bytes, isFloat), 1);
} }
function SAFE_HEAP_LOAD(dest, bytes, isFloat, unsigned) { function SAFE_HEAP_LOAD(dest, bytes, isFloat, unsigned) {
assert(dest > 0, 'segmentation fault'); assert(dest > 0, 'segmentation fault');
assert(dest % bytes === 0); assert(dest % bytes === 0, 'alignment error');
assert(dest < Math.max(DYNAMICTOP, STATICTOP)); assert(dest < Math.max(DYNAMICTOP, STATICTOP), 'segmentation fault (high)');
assert(DYNAMICTOP <= TOTAL_MEMORY); assert(DYNAMICTOP <= TOTAL_MEMORY);
var type = getSafeHeapType(bytes, isFloat); var type = getSafeHeapType(bytes, isFloat);
var ret = getValue(dest, type, 1); var ret = getValue(dest, type, 1);