Commit e30e3fd
committed
Fix use of uninitialized variable in inline_function().
Commit e717a9a introduced a code path that bypassed the call of
get_expr_result_type, which is not good because we need its rettupdesc
result to pass to check_sql_fn_retval. We'd failed to notice right
away because the code path in which check_sql_fn_retval uses that
argument is fairly hard to reach in this context. It's not impossible
though, and in any case inline_function would have no business
assuming that check_sql_fn_retval doesn't need that value.
To fix, move get_expr_result_type out of the if-block, which in
turn requires moving the construction of the dummy FuncExpr
out of it.
Per report from Ranier Vilela. (I'm bemused by the lack of any
compiler complaints...)
Discussion: https://postgr.es/m/CAEudQAqBqQpQ3HruWAGU_7WaMJ7tntpk0T8k_dVtNB46DqdBgw@mail.gmail.com1 parent 5e0b1ae commit e30e3fd
1 file changed
+22
-22
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4317 | 4317 | | |
4318 | 4318 | | |
4319 | 4319 | | |
| 4320 | + | |
| 4321 | + | |
| 4322 | + | |
| 4323 | + | |
| 4324 | + | |
| 4325 | + | |
| 4326 | + | |
| 4327 | + | |
| 4328 | + | |
| 4329 | + | |
| 4330 | + | |
| 4331 | + | |
| 4332 | + | |
| 4333 | + | |
| 4334 | + | |
| 4335 | + | |
4320 | 4336 | | |
4321 | 4337 | | |
4322 | 4338 | | |
| |||
4359 | 4375 | | |
4360 | 4376 | | |
4361 | 4377 | | |
4362 | | - | |
4363 | | - | |
4364 | | - | |
4365 | | - | |
4366 | | - | |
4367 | | - | |
4368 | | - | |
4369 | | - | |
4370 | | - | |
4371 | | - | |
4372 | | - | |
4373 | | - | |
4374 | | - | |
4375 | | - | |
4376 | | - | |
4377 | | - | |
4378 | | - | |
| 4378 | + | |
4379 | 4379 | | |
4380 | 4380 | | |
4381 | 4381 | | |
4382 | 4382 | | |
4383 | | - | |
4384 | | - | |
4385 | | - | |
4386 | | - | |
4387 | | - | |
4388 | 4383 | | |
4389 | 4384 | | |
4390 | 4385 | | |
| |||
4434 | 4429 | | |
4435 | 4430 | | |
4436 | 4431 | | |
| 4432 | + | |
| 4433 | + | |
| 4434 | + | |
| 4435 | + | |
| 4436 | + | |
4437 | 4437 | | |
4438 | 4438 | | |
4439 | 4439 | | |
| |||
0 commit comments