zig/test/cases/bugs
Andrew Kelley f8fe517d12
better string literal caching implementation
We were caching the ConstExprValue of string literals,
which works if you can never modify ConstExprValues.
This premise is broken with `comptime var ...`.

So I implemented an optimization in ConstExprValue
arrays, where it stores a `Buf *` directly rather
than an array of ConstExprValues for the elements,
and then similar to array of undefined, it is
expanded into the canonical form when necessary.
However many operations can happen directly on the
`Buf *`, which is faster.

Furthermore, before a ConstExprValue array is expanded
into canonical form, it removes itself from the string
literal cache. This fixes the issue, because before an
array element is modified it would have to be expanded.

closes #1076
2018-09-20 11:04:31 -04:00
..
394.zig
655_other_file.zig
655.zig
656.zig
726.zig add test case for #726 2018-09-05 18:20:04 -04:00
828.zig
920.zig
1076.zig better string literal caching implementation 2018-09-20 11:04:31 -04:00
1111.zig
1277.zig
1322.zig fix tagged union with all void payloads but meaningful tag 2018-09-14 00:38:22 -04:00
1381.zig fix incorrect union const value generation 2018-09-11 12:59:39 -04:00
1421.zig fix false negative determining if function is generic 2018-08-27 16:14:48 -04:00
1442.zig fix incorrect error union const value generation 2018-09-11 15:16:50 -04:00