From 72ac37952e00184dbbf727fb3e7d3477d5637a87 Mon Sep 17 00:00:00 2001 From: r00ster91 Date: Fri, 21 Jul 2023 23:08:04 +0200 Subject: fix @embedFile("") not giving a proper error Currently, in a debug build of the compiler, `@embedFile("")` is a crash; in a release build the compiler, `@embedFile("")` is "error: unable to open '': OutOfMemory". --- test/cases/compile_errors/@embedFile_with_empty_path.zig | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 test/cases/compile_errors/@embedFile_with_empty_path.zig (limited to 'test/cases/compile_errors/@embedFile_with_empty_path.zig') diff --git a/test/cases/compile_errors/@embedFile_with_empty_path.zig b/test/cases/compile_errors/@embedFile_with_empty_path.zig new file mode 100644 index 0000000000..305e8a74cc --- /dev/null +++ b/test/cases/compile_errors/@embedFile_with_empty_path.zig @@ -0,0 +1,11 @@ +const resource = @embedFile(""); + +export fn entry() usize { + return @sizeOf(@TypeOf(resource)); +} + +// error +// backend=stage2 +// target=native +// +// :1:29: error: file path name cannot be empty -- cgit v1.2.3