Fix emit_small_memset

This commit is contained in:
bjorn3
2019-03-02 20:19:11 +01:00
committed by Dan Gohman
parent a06d257253
commit 2d2b041766

View File

@@ -638,7 +638,7 @@ impl<'a> FunctionBuilder<'a> {
/// Calls libc.memset
///
/// Writes `size` bytes of value `ch` to memory starting at `buffer`.
/// Writes `size` bytes of i8 value `ch` to memory starting at `buffer`.
pub fn call_memset(
&mut self,
config: TargetFrontendConfig,
@@ -672,7 +672,7 @@ impl<'a> FunctionBuilder<'a> {
&mut self,
config: TargetFrontendConfig,
buffer: Value,
ch: u32,
ch: u8,
size: u64,
buffer_align: u8,
) {
@@ -702,7 +702,7 @@ impl<'a> FunctionBuilder<'a> {
let load_and_store_amount = size / access_size;
if load_and_store_amount > THRESHOLD {
let ch = self.ins().iconst(types::I32, i64::from(ch));
let ch = self.ins().iconst(types::I8, i64::from(ch));
let size = self.ins().iconst(config.pointer_type(), size as i64);
self.call_memset(config, buffer, ch, size);
} else {