Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitcf63c64

Browse files
committed
Fix portability issue in ordered-set patch.
Overly compact coding in makeOrderedSetArgs() led to a platform dependency:if the compiler chose to execute the subexpressions in the wrong order,list_length() might get applied to an already-modified List, giving avalue we didn't want. Per buildfarm.
1 parent8d65da1 commitcf63c64

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

‎src/backend/parser/gram.y

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13385,6 +13385,7 @@ makeOrderedSetArgs(List *directargs, List *orderedargs,
1338513385
core_yyscan_t yyscanner)
1338613386
{
1338713387
FunctionParameter *lastd = (FunctionParameter *) llast(directargs);
13388+
intndirectargs;
1338813389

1338913390
/* No restriction unless last direct arg is VARIADIC*/
1339013391
if (lastd->mode == FUNC_PARAM_VARIADIC)
@@ -13407,8 +13408,11 @@ makeOrderedSetArgs(List *directargs, List *orderedargs,
1340713408
orderedargs = NIL;
1340813409
}
1340913410

13411+
/* don't merge into the next line, as list_concat changes directargs*/
13412+
ndirectargs = list_length(directargs);
13413+
1341013414
return list_make2(list_concat(directargs, orderedargs),
13411-
makeInteger(list_length(directargs)));
13415+
makeInteger(ndirectargs));
1341213416
}
1341313417

1341413418
/* insertSelectOptions()

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp