Commit 1174b9f
Fix indeterminate ordering in typesToValues() (#4)
Summary:
X-link: hhvm/hhvm-staging#4
We depend on the evaluation order of the lambda passed to typesToValues() (in particular we depend on it being called for each element type in the tuple in the order in which they appear in the tuple). In C++ the order in which the values of function parameters are resolved is indeterminate:
> In a function call, value computations and side effects of the initialization of every parameter are indeterminately sequenced with respect to value computations and side effects of any other parameter.
https://en.cppreference.com/w/cpp/language/eval_order
This diff changes `typesToValuesImpl` to use a recursive definition that should have a well-defined order.
Reviewed By: ricklavoie, alexeyt
Differential Revision: D40489955
fbshipit-source-id: 4342dde6eeda4c1002795e4f7dc2ee41c98791521 parent 47fe355 commit 1174b9f
1 file changed
+16
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
299 | 299 | | |
300 | 300 | | |
301 | 301 | | |
302 | | - | |
| 302 | + | |
303 | 303 | | |
304 | | - | |
305 | | - | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
306 | 319 | | |
307 | 320 | | |
308 | 321 | | |
| |||
0 commit comments