- Notifications
You must be signed in to change notification settings - Fork28
Commit1bccb15
committed
Fix ecpg's mishandling of B'...' and X'...' literals.
These were broken in multiple ways:* The xbstart and xhstart lexer actions neglected to set"state_before_str_start" before transitioning to the xb/xh states,thus possibly resulting in "internal error: unreachable state" later.* The test for valid string contents at the end of xb state was flat outwrong, as it accounted incorrectly for the "b" prefix that the xbstartaction had injected. Meanwhile, the xh state had no such check at all.* The generated literal value failed to include any quote marks.* The grammar did the wrong thing anyway, typically ignoring theliteral value and emitting something else, since BCONST and XCONSTtokens were handled randomly differently from SCONST tokens.The first of these problems is evidently an oversight in commit7f380c5, but the others seem to be very ancient. The lack ofcomplaints shows that ECPG users aren't using these syntaxes much(although I do vaguely remember one previous complaint).As written, this patch is dependent on7f380c5, so it can't goback further than v13. Given the shortage of complaints, I'm notexcited about adapting the patch to prior branches.Report and patch by Shenhao Wang (test case adjusted by me)Discussion:https://postgr.es/m/d6402f1bacb74ecba22ef715dbba17fd@G08CNEXMBPEKD06.g08.fujitsu.local1 parentd94d37f commit1bccb15
File tree
8 files changed
+39
-8
lines changed- src/interfaces/ecpg
- preproc
- test
- expected
- preproc
8 files changed
+39
-8
lines changedLines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1715 | 1715 |
| |
1716 | 1716 |
| |
1717 | 1717 |
| |
1718 |
| - | |
| 1718 | + | |
1719 | 1719 |
| |
1720 | 1720 |
| |
1721 | 1721 |
| |
1722 | 1722 |
| |
1723 | 1723 |
| |
1724 |
| - | |
| 1724 | + | |
1725 | 1725 |
| |
1726 | 1726 |
| |
1727 | 1727 |
| |
|
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
122 | 122 |
| |
123 | 123 |
| |
124 | 124 |
| |
| 125 | + | |
125 | 126 |
| |
| 127 | + | |
126 | 128 |
| |
127 | 129 |
| |
128 | 130 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
38 | 38 |
| |
39 | 39 |
| |
40 | 40 |
| |
| 41 | + | |
41 | 42 |
| |
42 | 43 |
| |
43 | 44 |
| |
|
Lines changed: 7 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
505 | 505 |
| |
506 | 506 |
| |
507 | 507 |
| |
| 508 | + | |
508 | 509 |
| |
509 | 510 |
| |
510 |
| - | |
511 | 511 |
| |
512 | 512 |
| |
513 | 513 |
| |
| |||
519 | 519 |
| |
520 | 520 |
| |
521 | 521 |
| |
| 522 | + | |
522 | 523 |
| |
523 | 524 |
| |
524 |
| - | |
525 | 525 |
| |
526 | 526 |
| |
527 | 527 |
| |
| |||
597 | 597 |
| |
598 | 598 |
| |
599 | 599 |
| |
600 |
| - | |
| 600 | + | |
601 | 601 |
| |
602 |
| - | |
| 602 | + | |
603 | 603 |
| |
604 | 604 |
| |
605 |
| - | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
606 | 608 |
| |
607 | 609 |
| |
608 | 610 |
| |
|
Lines changed: 11 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
63 | 63 |
| |
64 | 64 |
| |
65 | 65 |
| |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
66 | 76 |
| |
67 |
| - | |
| 77 | + | |
68 | 78 |
| |
69 | 79 |
| |
70 | 80 |
|
Lines changed: 10 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
38 | 38 |
| |
39 | 39 |
| |
40 | 40 |
| |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
41 | 51 |
| |
42 | 52 |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | 1 |
| |
| 2 | + |
Lines changed: 5 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
22 | 22 |
| |
23 | 23 |
| |
24 | 24 |
| |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
25 | 30 |
| |
26 | 31 |
| |
27 | 32 |
|
0 commit comments
Comments
(0)