diff --git a/internal/abi/memory.go b/internal/abi/memory.go index a3761bb..a59b3aa 100644 --- a/internal/abi/memory.go +++ b/internal/abi/memory.go @@ -1012,6 +1012,9 @@ func allocStoreList(mem []byte, list []Value, elemType bintype.TypeDesc, resolve if err != nil { return 0, 0, fmt.Errorf("realloc failed: %w", err) } + if newPtr%elemAlign != 0 { + return 0, 0, fmt.Errorf("realloc return: %s pointer %d not aligned to %d", elemType.Kind(), newPtr, elemAlign) + } if _, _, err := checkedRange(len(mem), newPtr, byteLen); err != nil { return 0, 0, fmt.Errorf("allocated memory out of bounds: ptr=%d size=%d", newPtr, byteLen) diff --git a/testdata/conformance/xfail.json b/testdata/conformance/xfail.json index e936afb..037fbcc 100644 --- a/testdata/conformance/xfail.json +++ b/testdata/conformance/xfail.json @@ -540,7 +540,6 @@ "values__post-return__0015__L215/action/L216": "required canonical ABI trap is not enforced", "values__post-return__0029__L229/action/L230": "required canonical ABI trap is not enforced", "values__post-return__0043__L243/action/L244": "required canonical ABI trap is not enforced", - "values__realloc__0006__L93/action/L94": "required canonical ABI trap is not enforced", "values__transcode__0000__L7/action/L113": "canonical transcoding semantics are incomplete", "values__transcode__0002__L117/action/L201": "217: call: component/instance: export \"run\": call core func \"run\": component/instance: host import \"join\" \"\": component/instance: export \"join\": call core func \"join\": wasm trap...", "values__transcode__0004__L205/action/L319": "canonical transcoding semantics are incomplete",