| author | |
| committer | |
| log | 280140595fcfe9676ed32a7906eb7958a4c595b1 |
| tree | 8df25bbd8a24970749382cd2aaf4bc092e84c20c |
| parent | f29302f9152a0c15641596c148a2d784991fe7d8 |
This duplicates the source file string (as is done in other places such
as `addAssemblyFile()`) in order to prevent a segfault when the supplied
string is freed by the caller. This is still seen when the caller makes
use of a defer statement.1 files changed, 1 insertions(+), 1 deletions(-)
lib/std/Build.zig+1-1| ... | ... | @@ -869,7 +869,7 @@ pub fn createModule(b: *Build, options: CreateModuleOptions) *Module { |
| 869 | 869 | const module = b.allocator.create(Module) catch @panic("OOM"); |
| 870 | 870 | module.* = .{ |
| 871 | 871 | .builder = b, |
| 872 | .source_file = options.source_file, | |
| 872 | .source_file = options.source_file.dupe(b), | |
| 873 | 873 | .dependencies = moduleDependenciesToArrayHashMap(b.allocator, options.dependencies), |
| 874 | 874 | }; |
| 875 | 875 | return module; |