summaryrefslogtreecommitdiff
path: root/src/wasm/wasm-s-parser.cpp
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2018-11-13 16:36:29 -0800
committerGitHub <noreply@github.com>2018-11-13 16:36:29 -0800
commitb67917ee7392c4d49402cb5e7320e663208390ef (patch)
treebfc32d7f2bbd007e10dbc6a7c6fa352673552741 /src/wasm/wasm-s-parser.cpp
parent6b99d143a32263478b7d525886b0bea46cbbdcaa (diff)
downloadbinaryen-b67917ee7392c4d49402cb5e7320e663208390ef.tar.gz
binaryen-b67917ee7392c4d49402cb5e7320e663208390ef.tar.bz2
binaryen-b67917ee7392c4d49402cb5e7320e663208390ef.zip
Fix alignment in MixedAllocator (#1740)
Necessary for simd, as we add a type with alignment >8. We were just broken on that before this PR.
Diffstat (limited to 'src/wasm/wasm-s-parser.cpp')
-rw-r--r--src/wasm/wasm-s-parser.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/wasm/wasm-s-parser.cpp b/src/wasm/wasm-s-parser.cpp
index b81b32ad6..79407a3f8 100644
--- a/src/wasm/wasm-s-parser.cpp
+++ b/src/wasm/wasm-s-parser.cpp
@@ -166,7 +166,7 @@ void SExpressionParser::parseDebugLocation() {
return; // no column number
}
std::string colStr(++pos, debugLocEnd);
- void* buf = allocator.allocSpace(sizeof(SourceLocation));
+ void* buf = allocator.allocSpace(sizeof(SourceLocation), alignof(SourceLocation));
loc = new (buf) SourceLocation(IString(name.c_str(), false), atoi(lineStr.c_str()), atoi(colStr.c_str()));
}