| author | |
| committer | |
| log | 18b46485bcb6ad6b4be31c87659ffd78a311c904 |
| tree | 8d62c1a25260a1833f82b77ec82e8d454531408a |
| parent | 622a3ac876a6eac17b768625350326e9ff121f4e |
After calling gpa.destroy the object is gone for good, setting the
contents to undefined is a bug and may crash the compiler.1 files changed, 0 insertions(+), 1 deletions(-)
src/Compilation.zig-1| ... | @@ -232,7 +232,6 @@ pub const CObject = struct { | ... | @@ -232,7 +232,6 @@ pub const CObject = struct { |
| 232 | pub fn destroy(em: *ErrorMsg, gpa: *Allocator) void { | 232 | pub fn destroy(em: *ErrorMsg, gpa: *Allocator) void { |
| 233 | gpa.free(em.msg); | 233 | gpa.free(em.msg); |
| 234 | gpa.destroy(em); | 234 | gpa.destroy(em); |
| 235 | em.* = undefined; | ||
| 236 | } | 235 | } |
| 237 | }; | 236 | }; |
| 238 | 237 |