aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/MC/MCParser/AsmParser.cpp8
-rw-r--r--test/MC/AsmParser/directive_incbin.s5
2 files changed, 5 insertions, 8 deletions
diff --git a/lib/MC/MCParser/AsmParser.cpp b/lib/MC/MCParser/AsmParser.cpp
index 93492377ff..4ab60c1cdc 100644
--- a/lib/MC/MCParser/AsmParser.cpp
+++ b/lib/MC/MCParser/AsmParser.cpp
@@ -442,11 +442,11 @@ bool AsmParser::ProcessIncbinFile(const std::string &Filename) {
if (NewBuf == -1)
return true;
- // Loop picking the bytes from the file and emitting them.
+ // Pick up the bytes from the file and emit them.
const char *BufferStart = SrcMgr.getMemoryBuffer(NewBuf)->getBufferStart();
- const char *BufferEnd = SrcMgr.getMemoryBuffer(NewBuf)->getBufferEnd();
- for(const char *p = BufferStart; p < BufferEnd; p++)
- getStreamer().EmitIntValue(*p, 1, DEFAULT_ADDRSPACE);
+ size_t BufferSize = SrcMgr.getMemoryBuffer(NewBuf)->getBufferSize();
+ std::string Data(BufferStart, BufferSize);
+ getStreamer().EmitBytes(Data, DEFAULT_ADDRSPACE);
return false;
}
diff --git a/test/MC/AsmParser/directive_incbin.s b/test/MC/AsmParser/directive_incbin.s
index 230573c648..55f9c7951f 100644
--- a/test/MC/AsmParser/directive_incbin.s
+++ b/test/MC/AsmParser/directive_incbin.s
@@ -3,7 +3,4 @@
.data
.incbin "incbin_abcd"
-# CHECK: .byte 97
-# CHECK: .byte 98
-# CHECK: .byte 99
-# CHECK: .byte 100
+# CHECK: .ascii "abcd\n"