diff options
author | Alon Zakai <alonzakai@gmail.com> | 2014-02-06 17:28:48 -0500 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2014-02-06 17:28:48 -0500 |
commit | a55ff5ad9716e37fbd4dbaf741de340966060637 (patch) | |
tree | 81ab8abf129bedf3fcf0c9f5b2bd9f8387bebe22 /lib | |
parent | 80064ba8c5da328b8ace635011e2ab4a00d40676 (diff) |
handle align 0 in memcpy and memset
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Target/JSBackend/CallHandlers.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Target/JSBackend/CallHandlers.h b/lib/Target/JSBackend/CallHandlers.h index 979bf8a46b..ee99476367 100644 --- a/lib/Target/JSBackend/CallHandlers.h +++ b/lib/Target/JSBackend/CallHandlers.h @@ -241,7 +241,7 @@ DEF_CALL_HANDLER(llvm_memcpy_p0i8_p0i8_i32, { unsigned Len = LenInt->getZExtValue(); if (Len <= WRITE_LOOP_MAX) { unsigned Align = AlignInt->getZExtValue(); - if (Align > 4) Align = 4; + if (Align > 4 || Align == 0) Align = 4; unsigned Pos = 0; std::string Ret; std::string Dest = getValueAsStr(CI->getOperand(0)); @@ -288,7 +288,7 @@ DEF_CALL_HANDLER(llvm_memset_p0i8_i32, { if (Len <= WRITE_LOOP_MAX) { unsigned Align = AlignInt->getZExtValue(); unsigned Val = ValInt->getZExtValue(); - if (Align > 4) Align = 4; + if (Align > 4 || Align == 0) Align = 4; unsigned Pos = 0; std::string Ret; std::string Dest = getValueAsStr(CI->getOperand(0)); |