| ... | @@ -12633,6 +12633,10 @@ fn zirEmbedFile(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!A | ... | @@ -12633,6 +12633,10 @@ fn zirEmbedFile(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!A |
| 12633 | const operand_src: LazySrcLoc = .{ .node_offset_builtin_call_arg0 = inst_data.src_node }; | 12633 | const operand_src: LazySrcLoc = .{ .node_offset_builtin_call_arg0 = inst_data.src_node }; |
| 12634 | const name = try sema.resolveConstString(block, operand_src, inst_data.operand, "file path name must be comptime-known"); | 12634 | const name = try sema.resolveConstString(block, operand_src, inst_data.operand, "file path name must be comptime-known"); |
| 12635 | | 12635 | |
| | 12636 | if (name.len == 0) { |
| | 12637 | return sema.fail(block, operand_src, "file path name cannot be empty", .{}); |
| | 12638 | } |
| | 12639 | |
| 12636 | const embed_file = mod.embedFile(block.getFileScope(mod), name) catch |err| switch (err) { | 12640 | const embed_file = mod.embedFile(block.getFileScope(mod), name) catch |err| switch (err) { |
| 12637 | error.ImportOutsidePkgPath => { | 12641 | error.ImportOutsidePkgPath => { |
| 12638 | return sema.fail(block, operand_src, "embed of file outside package path: '{s}'", .{name}); | 12642 | return sema.fail(block, operand_src, "embed of file outside package path: '{s}'", .{name}); |