Commit 2759e47
authored
[clang-repl] We do not need to call new in the object allocation. (#78843)
This test demonstrates template instantiation via the interpreter code.
In order to do that we can allocate the object on the stack and extend
its lifetime by boxing it into a clang::Value.
That avoids the subtle problem where we call the new operator on an
object only known to the interpreter and we cannot destroy it from
compiled code since there is not suitable facility in clang::Value yet.
That should resolve the asan issues that was reported in
#76218.1 parent dedc7d4 commit 2759e47
1 file changed
+6
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | 37 | | |
44 | 38 | | |
45 | 39 | | |
| |||
257 | 251 | | |
258 | 252 | | |
259 | 253 | | |
260 | | - | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
261 | 260 | | |
262 | 261 | | |
263 | 262 | | |
| |||
317 | 316 | | |
318 | 317 | | |
319 | 318 | | |
320 | | - | |
321 | | - | |
322 | 319 | | |
323 | 320 | | |
324 | 321 | | |
| |||
0 commit comments