[CPU] Fix null termination in HIRBuilder::CommentFormat.

This commit is contained in:
gibbed 2018-11-23 07:50:42 -06:00
parent d04c748773
commit 94284ea9aa
1 changed files with 1 additions and 1 deletions

View File

@ -764,7 +764,7 @@ void HIRBuilder::CommentFormat(const char* format, ...) {
va_start(args, format);
size_t chars_written = vsnprintf(p, kMaxCommentSize - 1, format, args);
va_end(args);
size_t rewind = kMaxCommentSize - chars_written;
size_t rewind = kMaxCommentSize - chars_written - 1;
arena_->Rewind(rewind);
Instr* i = AppendInstr(OPCODE_COMMENT_info, 0);
i->src1.offset = (uint64_t)p;