In v0.6.0
Minimal Repro:
const std = @import("std");
const zlua = @import("zlua");
const Lua = zlua.Lua;
pub fn main() anyerror!void {
var gpa: std.heap.DebugAllocator(.{}) = .init;
const allocator = gpa.allocator();
defer _ = gpa.deinit();
var lua = try Lua.init(allocator);
defer lua.deinit();
lua.openLibs();
try lua.doString(
\\local test = {}
\\ test[math.huge] = "To infinity"
\\ print(test[math.huge])
\\ return test
);
}
I put this in the examples folder, created a separate example for it in build.zig and used the following:
zig build -Dlang=lua51 run-example-ubsan
It seems to only happen for lua51. Did not get the same error for > 5.1
It does NOT fail with luajit because that has sanitize-c set to off