Skip to content

Commit 41790f2

Browse files
fix: still write 1 byte string if no string's here
1 parent bafc95e commit 41790f2

File tree

3 files changed

+2
-6
lines changed

3 files changed

+2
-6
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
.xmake
22
build
3-
.cache
3+
.cache
4+
test

src/lua_bytecode_parser.cc

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -411,11 +411,6 @@ void LuaBytecodeWriter::write_block(const char *buffer, size_t size) {
411411
}
412412

413413
void LuaBytecodeWriter::write_string(const std::string &s) {
414-
if (s.empty()) {
415-
write_byte(0);
416-
return;
417-
}
418-
419414
size_t size = s.length() + 1;
420415
if (size < 0xFF) {
421416
write_byte(static_cast<std::uint8_t>(size));

test/luac.out

-147 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)