Add post-update nodes for implicit field read nodes

This commit is contained in:
Owen Mansel-Chan
2025-11-26 10:18:02 +00:00
parent dcfa721037
commit a20c8cfd52
7 changed files with 5 additions and 117 deletions

View File

@@ -838,7 +838,11 @@ module Public {
exists(IR::MethodReadInstruction mri |
ce.getTarget() instanceof Method and
mri = IR::evalExprInstruction(ce.getCalleeExpr()) and
insn = mri.getReceiver()
// If a.x is reading a promoted field, and it's equivalent to a.b.c.x,
// then mri.getReceiver() will give us the implicit field read a.b.c
// and we want to have post-update nodes for a, the implicit field
// read a.b and the implicit field read a.b.c.
insn = IR::lookThroughImplicitFieldRead*(mri.getReceiver())
)
) and
mutableType(insn.getResultType())

View File

@@ -1,11 +1,5 @@
reverseRead
| pkg1/embedding.go:56:29:56:39 | implicit dereference | Origin of readStep is missing a PostUpdateNode. |
| pkg1/embedding.go:57:33:57:46 | implicit dereference | Origin of readStep is missing a PostUpdateNode. |
| pkg1/embedding.go:58:14:58:22 | implicit read of field embedder | Origin of readStep is missing a PostUpdateNode. |
| pkg1/embedding.go:58:31:58:42 | implicit read of field embedder | Origin of readStep is missing a PostUpdateNode. |
| pkg1/tst.go:43:6:43:6 | t | Origin of readStep is missing a PostUpdateNode. |
| pkg1/tst.go:46:6:46:6 | t | Origin of readStep is missing a PostUpdateNode. |
| pkg1/tst.go:50:2:50:2 | t | Origin of readStep is missing a PostUpdateNode. |
| pkg1/tst.go:53:6:53:7 | t2 | Origin of readStep is missing a PostUpdateNode. |
| pkg1/tst.go:55:6:55:7 | t2 | Origin of readStep is missing a PostUpdateNode. |
| promoted.go:18:6:18:6 | t | Origin of readStep is missing a PostUpdateNode. |

View File

@@ -1,37 +0,0 @@
reverseRead
| test_methods.go:44:7:44:7 | t | Origin of readStep is missing a PostUpdateNode. |
| test_methods.go:45:7:45:7 | t | Origin of readStep is missing a PostUpdateNode. |
| test_methods.go:46:2:46:2 | t | Origin of readStep is missing a PostUpdateNode. |
| test_methods.go:50:7:50:7 | t | Origin of readStep is missing a PostUpdateNode. |
| test_methods.go:51:7:51:7 | t | Origin of readStep is missing a PostUpdateNode. |
| test_methods.go:52:2:52:2 | t | Origin of readStep is missing a PostUpdateNode. |
| test_methods.go:92:7:92:7 | t | Origin of readStep is missing a PostUpdateNode. |
| test_methods.go:93:7:93:7 | t | Origin of readStep is missing a PostUpdateNode. |
| test_methods.go:94:2:94:2 | t | Origin of readStep is missing a PostUpdateNode. |
| test_methods.go:98:7:98:7 | t | Origin of readStep is missing a PostUpdateNode. |
| test_methods.go:99:7:99:7 | t | Origin of readStep is missing a PostUpdateNode. |
| test_methods.go:100:2:100:2 | t | Origin of readStep is missing a PostUpdateNode. |
| test_methods.go:104:7:104:7 | t | Origin of readStep is missing a PostUpdateNode. |
| test_methods.go:105:7:105:7 | t | Origin of readStep is missing a PostUpdateNode. |
| test_methods.go:106:2:106:2 | t | Origin of readStep is missing a PostUpdateNode. |
| test_methods.go:110:7:110:7 | t | Origin of readStep is missing a PostUpdateNode. |
| test_methods.go:111:7:111:7 | t | Origin of readStep is missing a PostUpdateNode. |
| test_methods.go:112:2:112:2 | t | Origin of readStep is missing a PostUpdateNode. |
| test_methods.go:140:7:140:7 | implicit read of field SEmbedI1 | Origin of readStep is missing a PostUpdateNode. |
| test_methods.go:141:7:141:7 | implicit read of field SEmbedI1 | Origin of readStep is missing a PostUpdateNode. |
| test_methods.go:142:2:142:2 | implicit read of field SEmbedI1 | Origin of readStep is missing a PostUpdateNode. |
| test_methods.go:146:7:146:7 | implicit read of field SEmbedS1 | Origin of readStep is missing a PostUpdateNode. |
| test_methods.go:147:7:147:7 | implicit read of field SEmbedS1 | Origin of readStep is missing a PostUpdateNode. |
| test_methods.go:148:2:148:2 | implicit read of field SEmbedS1 | Origin of readStep is missing a PostUpdateNode. |
| test_methods.go:152:7:152:7 | implicit read of field SEmbedPtrS1 | Origin of readStep is missing a PostUpdateNode. |
| test_methods.go:153:7:153:7 | implicit read of field SEmbedPtrS1 | Origin of readStep is missing a PostUpdateNode. |
| test_methods.go:154:2:154:2 | implicit read of field SEmbedPtrS1 | Origin of readStep is missing a PostUpdateNode. |
| test_methods.go:158:7:158:7 | implicit read of field SEmbedS1 | Origin of readStep is missing a PostUpdateNode. |
| test_methods.go:159:7:159:7 | implicit read of field SEmbedS1 | Origin of readStep is missing a PostUpdateNode. |
| test_methods.go:160:2:160:2 | implicit read of field SEmbedS1 | Origin of readStep is missing a PostUpdateNode. |
| test_methods.go:164:7:164:7 | implicit read of field SEmbedPtrS1 | Origin of readStep is missing a PostUpdateNode. |
| test_methods.go:165:7:165:7 | implicit read of field SEmbedPtrS1 | Origin of readStep is missing a PostUpdateNode. |
| test_methods.go:166:2:166:2 | implicit read of field SEmbedPtrS1 | Origin of readStep is missing a PostUpdateNode. |
| test_methods.go:170:7:170:7 | t | Origin of readStep is missing a PostUpdateNode. |
| test_methods.go:171:7:171:7 | t | Origin of readStep is missing a PostUpdateNode. |
| test_methods.go:172:2:172:2 | t | Origin of readStep is missing a PostUpdateNode. |

View File

@@ -1,7 +0,0 @@
reverseRead
| methods.go:48:2:48:6 | base1 | Origin of readStep is missing a PostUpdateNode. |
| methods.go:58:2:58:7 | implicit dereference | Origin of readStep is missing a PostUpdateNode. |
| methods.go:67:2:67:6 | base2 | Origin of readStep is missing a PostUpdateNode. |
| methods.go:68:2:68:6 | base2 | Origin of readStep is missing a PostUpdateNode. |
| methods.go:77:2:77:7 | implicit dereference | Origin of readStep is missing a PostUpdateNode. |
| methods.go:78:2:78:7 | base2p | Origin of readStep is missing a PostUpdateNode. |

View File

@@ -1,20 +0,0 @@
reverseRead
| test_couchbase_gocb_v2.go:151:2:151:10 | call to Next | Origin of readStep is missing a PostUpdateNode. |
| test_couchbase_gocb_v2.go:161:2:161:3 | r7 | Origin of readStep is missing a PostUpdateNode. |
| test_jmoiron_sqlx.go:66:6:66:9 | rows | Origin of readStep is missing a PostUpdateNode. |
| test_jmoiron_sqlx.go:69:9:69:12 | rows | Origin of readStep is missing a PostUpdateNode. |
| test_jmoiron_sqlx.go:80:18:80:19 | db | Origin of readStep is missing a PostUpdateNode. |
| test_jmoiron_sqlx.go:89:8:89:11 | rows | Origin of readStep is missing a PostUpdateNode. |
| test_jmoiron_sqlx.go:91:6:91:9 | rows | Origin of readStep is missing a PostUpdateNode. |
| test_jmoiron_sqlx.go:94:9:94:12 | rows | Origin of readStep is missing a PostUpdateNode. |
| test_jmoiron_sqlx.go:151:8:151:11 | rows | Origin of readStep is missing a PostUpdateNode. |
| test_jmoiron_sqlx.go:153:6:153:9 | rows | Origin of readStep is missing a PostUpdateNode. |
| test_jmoiron_sqlx.go:156:9:156:12 | rows | Origin of readStep is missing a PostUpdateNode. |
| test_jmoiron_sqlx.go:198:18:198:21 | stmt | Origin of readStep is missing a PostUpdateNode. |
| test_jmoiron_sqlx.go:207:8:207:11 | rows | Origin of readStep is missing a PostUpdateNode. |
| test_jmoiron_sqlx.go:209:6:209:9 | rows | Origin of readStep is missing a PostUpdateNode. |
| test_jmoiron_sqlx.go:212:9:212:12 | rows | Origin of readStep is missing a PostUpdateNode. |
| test_jmoiron_sqlx.go:254:18:254:19 | tx | Origin of readStep is missing a PostUpdateNode. |
| test_jmoiron_sqlx.go:263:8:263:11 | rows | Origin of readStep is missing a PostUpdateNode. |
| test_jmoiron_sqlx.go:265:6:265:9 | rows | Origin of readStep is missing a PostUpdateNode. |
| test_jmoiron_sqlx.go:268:9:268:12 | rows | Origin of readStep is missing a PostUpdateNode. |

View File

@@ -1,2 +0,0 @@
reverseRead
| main.go:19:2:19:4 | ctx | Origin of readStep is missing a PostUpdateNode. |

View File

@@ -1,42 +1,29 @@
reverseRead
| EndToEnd.go:30:9:30:9 | c | Origin of readStep is missing a PostUpdateNode. |
| EndToEnd.go:30:35:30:35 | implicit read of field Controller | Origin of readStep is missing a PostUpdateNode. |
| EndToEnd.go:30:35:30:42 | implicit dereference | Origin of readStep is missing a PostUpdateNode. |
| EndToEnd.go:36:18:36:18 | implicit read of field Controller | Origin of readStep is missing a PostUpdateNode. |
| EndToEnd.go:36:18:36:25 | implicit dereference | Origin of readStep is missing a PostUpdateNode. |
| EndToEnd.go:37:9:37:9 | c | Origin of readStep is missing a PostUpdateNode. |
| EndToEnd.go:44:18:44:18 | implicit read of field Controller | Origin of readStep is missing a PostUpdateNode. |
| EndToEnd.go:44:18:44:25 | implicit dereference | Origin of readStep is missing a PostUpdateNode. |
| EndToEnd.go:45:9:45:9 | c | Origin of readStep is missing a PostUpdateNode. |
| EndToEnd.go:51:20:51:20 | implicit read of field Controller | Origin of readStep is missing a PostUpdateNode. |
| EndToEnd.go:51:20:51:27 | implicit dereference | Origin of readStep is missing a PostUpdateNode. |
| EndToEnd.go:52:9:52:9 | c | Origin of readStep is missing a PostUpdateNode. |
| EndToEnd.go:58:18:58:18 | implicit read of field Controller | Origin of readStep is missing a PostUpdateNode. |
| EndToEnd.go:58:18:58:25 | implicit dereference | Origin of readStep is missing a PostUpdateNode. |
| EndToEnd.go:59:9:59:9 | c | Origin of readStep is missing a PostUpdateNode. |
| EndToEnd.go:64:9:64:9 | c | Origin of readStep is missing a PostUpdateNode. |
| EndToEnd.go:64:26:64:26 | implicit read of field Controller | Origin of readStep is missing a PostUpdateNode. |
| EndToEnd.go:64:26:64:33 | implicit dereference | Origin of readStep is missing a PostUpdateNode. |
| EndToEnd.go:69:9:69:9 | c | Origin of readStep is missing a PostUpdateNode. |
| EndToEnd.go:69:22:69:22 | implicit read of field Controller | Origin of readStep is missing a PostUpdateNode. |
| EndToEnd.go:69:22:69:29 | implicit dereference | Origin of readStep is missing a PostUpdateNode. |
| EndToEnd.go:74:9:74:9 | c | Origin of readStep is missing a PostUpdateNode. |
| EndToEnd.go:74:22:74:22 | implicit read of field Controller | Origin of readStep is missing a PostUpdateNode. |
| EndToEnd.go:74:22:74:29 | implicit dereference | Origin of readStep is missing a PostUpdateNode. |
| EndToEnd.go:79:9:79:9 | c | Origin of readStep is missing a PostUpdateNode. |
| EndToEnd.go:79:35:79:35 | implicit read of field Controller | Origin of readStep is missing a PostUpdateNode. |
| EndToEnd.go:79:35:79:42 | implicit dereference | Origin of readStep is missing a PostUpdateNode. |
| EndToEnd.go:84:9:84:9 | c | Origin of readStep is missing a PostUpdateNode. |
| EndToEnd.go:84:22:84:22 | implicit read of field Controller | Origin of readStep is missing a PostUpdateNode. |
| EndToEnd.go:84:22:84:29 | implicit dereference | Origin of readStep is missing a PostUpdateNode. |
| EndToEnd.go:89:9:89:9 | c | Origin of readStep is missing a PostUpdateNode. |
| EndToEnd.go:89:21:89:21 | implicit read of field Controller | Origin of readStep is missing a PostUpdateNode. |
| EndToEnd.go:89:21:89:28 | implicit dereference | Origin of readStep is missing a PostUpdateNode. |
| EndToEnd.go:94:9:94:9 | c | Origin of readStep is missing a PostUpdateNode. |
| EndToEnd.go:94:20:94:20 | implicit read of field Controller | Origin of readStep is missing a PostUpdateNode. |
| EndToEnd.go:94:20:94:27 | implicit dereference | Origin of readStep is missing a PostUpdateNode. |
| Revel.go:26:7:26:7 | implicit read of field Controller | Origin of readStep is missing a PostUpdateNode. |
| Revel.go:26:7:26:14 | implicit dereference | Origin of readStep is missing a PostUpdateNode. |
| Revel.go:27:7:27:7 | implicit read of field Controller | Origin of readStep is missing a PostUpdateNode. |
| Revel.go:27:7:27:14 | implicit dereference | Origin of readStep is missing a PostUpdateNode. |
| Revel.go:30:2:30:2 | implicit read of field Controller | Origin of readStep is missing a PostUpdateNode. |
@@ -55,7 +42,6 @@ reverseRead
| Revel.go:60:7:60:14 | implicit dereference | Origin of readStep is missing a PostUpdateNode. |
| Revel.go:63:2:63:2 | implicit read of field Controller | Origin of readStep is missing a PostUpdateNode. |
| Revel.go:70:22:70:22 | implicit read of field Controller | Origin of readStep is missing a PostUpdateNode. |
| Revel.go:71:2:71:2 | c | Origin of readStep is missing a PostUpdateNode. |
| Revel.go:75:7:75:7 | implicit dereference | Origin of readStep is missing a PostUpdateNode. |
| Revel.go:76:7:76:7 | implicit dereference | Origin of readStep is missing a PostUpdateNode. |
| Revel.go:77:7:77:7 | implicit dereference | Origin of readStep is missing a PostUpdateNode. |
@@ -87,64 +73,34 @@ reverseRead
| Revel.go:128:14:128:22 | implicit dereference | Origin of readStep is missing a PostUpdateNode. |
| Revel.go:133:13:133:13 | implicit dereference | Origin of readStep is missing a PostUpdateNode. |
| examples/booking/app/controllers/app.go:34:2:34:2 | implicit read of field Controller | Origin of readStep is missing a PostUpdateNode. |
| examples/booking/app/controllers/app.go:45:10:45:10 | implicit read of field Controller | Origin of readStep is missing a PostUpdateNode. |
| examples/booking/app/controllers/app.go:47:2:47:2 | implicit read of field Controller | Origin of readStep is missing a PostUpdateNode. |
| examples/booking/app/controllers/app.go:48:9:48:9 | implicit read of field Controller | Origin of readStep is missing a PostUpdateNode. |
| examples/booking/app/controllers/app.go:52:9:52:9 | implicit read of field Controller | Origin of readStep is missing a PostUpdateNode. |
| examples/booking/app/controllers/app.go:56:2:56:2 | implicit read of field Controller | Origin of readStep is missing a PostUpdateNode. |
| examples/booking/app/controllers/app.go:57:2:57:2 | implicit read of field Controller | Origin of readStep is missing a PostUpdateNode. |
| examples/booking/app/controllers/app.go:59:16:59:16 | implicit read of field Controller | Origin of readStep is missing a PostUpdateNode. |
| examples/booking/app/controllers/app.go:61:5:61:5 | implicit read of field Controller | Origin of readStep is missing a PostUpdateNode. |
| examples/booking/app/controllers/app.go:62:3:62:3 | implicit read of field Controller | Origin of readStep is missing a PostUpdateNode. |
| examples/booking/app/controllers/app.go:63:3:63:3 | implicit read of field Controller | Origin of readStep is missing a PostUpdateNode. |
| examples/booking/app/controllers/app.go:64:10:64:10 | implicit read of field Controller | Origin of readStep is missing a PostUpdateNode. |
| examples/booking/app/controllers/app.go:68:2:68:2 | implicit read of field Controller | Origin of readStep is missing a PostUpdateNode. |
| examples/booking/app/controllers/app.go:69:9:69:9 | implicit read of field Controller | Origin of readStep is missing a PostUpdateNode. |
| examples/booking/app/controllers/app.go:79:5:79:5 | implicit read of field Controller | Origin of readStep is missing a PostUpdateNode. |
| examples/booking/app/controllers/app.go:81:5:81:5 | implicit read of field Controller | Origin of readStep is missing a PostUpdateNode. |
| examples/booking/app/controllers/app.go:83:4:83:4 | implicit read of field Controller | Origin of readStep is missing a PostUpdateNode. |
| examples/booking/app/controllers/app.go:84:11:84:11 | implicit read of field Controller | Origin of readStep is missing a PostUpdateNode. |
| examples/booking/app/controllers/app.go:89:2:89:2 | implicit read of field Controller | Origin of readStep is missing a PostUpdateNode. |
| examples/booking/app/controllers/app.go:90:9:90:9 | implicit read of field Controller | Origin of readStep is missing a PostUpdateNode. |
| examples/booking/app/controllers/app.go:95:10:95:10 | implicit read of field Controller | Origin of readStep is missing a PostUpdateNode. |
| examples/booking/app/controllers/app.go:97:9:97:9 | implicit read of field Controller | Origin of readStep is missing a PostUpdateNode. |
| examples/booking/app/controllers/hotels.go:43:13:43:13 | c | Origin of readStep is missing a PostUpdateNode. |
| examples/booking/app/controllers/hotels.go:44:3:44:3 | implicit read of field Controller | Origin of readStep is missing a PostUpdateNode. |
| examples/booking/app/controllers/hotels.go:45:10:45:10 | c | Origin of readStep is missing a PostUpdateNode. |
| examples/booking/app/controllers/hotels.go:51:2:51:2 | implicit read of field Controller | Origin of readStep is missing a PostUpdateNode. |
| examples/booking/app/controllers/hotels.go:54:9:54:9 | c | Origin of readStep is missing a PostUpdateNode. |
| examples/booking/app/controllers/hotels.go:107:9:107:9 | c | Origin of readStep is missing a PostUpdateNode. |
| examples/booking/app/controllers/hotels.go:118:9:118:9 | c | Origin of readStep is missing a PostUpdateNode. |
| examples/booking/app/controllers/hotels.go:132:10:132:10 | c | Origin of readStep is missing a PostUpdateNode. |
| examples/booking/app/controllers/hotels.go:135:9:135:9 | c | Origin of readStep is missing a PostUpdateNode. |
| examples/booking/app/controllers/hotels.go:139:9:139:9 | c | Origin of readStep is missing a PostUpdateNode. |
| examples/booking/app/controllers/hotels.go:143:26:143:26 | implicit read of field Controller | Origin of readStep is missing a PostUpdateNode. |
| examples/booking/app/controllers/hotels.go:144:2:144:2 | implicit read of field Controller | Origin of readStep is missing a PostUpdateNode. |
| examples/booking/app/controllers/hotels.go:146:2:146:2 | implicit read of field Controller | Origin of readStep is missing a PostUpdateNode. |
| examples/booking/app/controllers/hotels.go:148:5:148:5 | implicit read of field Controller | Origin of readStep is missing a PostUpdateNode. |
| examples/booking/app/controllers/hotels.go:149:3:149:3 | implicit read of field Controller | Origin of readStep is missing a PostUpdateNode. |
| examples/booking/app/controllers/hotels.go:150:10:150:10 | c | Origin of readStep is missing a PostUpdateNode. |
| examples/booking/app/controllers/hotels.go:153:2:153:2 | implicit read of field Controller | Origin of readStep is missing a PostUpdateNode. |
| examples/booking/app/controllers/hotels.go:154:9:154:9 | c | Origin of readStep is missing a PostUpdateNode. |
| examples/booking/app/controllers/hotels.go:160:10:160:10 | c | Origin of readStep is missing a PostUpdateNode. |
| examples/booking/app/controllers/hotels.go:165:17:165:17 | c | Origin of readStep is missing a PostUpdateNode. |
| examples/booking/app/controllers/hotels.go:166:19:166:19 | implicit read of field Controller | Origin of readStep is missing a PostUpdateNode. |
| examples/booking/app/controllers/hotels.go:168:5:168:5 | implicit read of field Controller | Origin of readStep is missing a PostUpdateNode. |
| examples/booking/app/controllers/hotels.go:168:33:168:33 | implicit read of field Controller | Origin of readStep is missing a PostUpdateNode. |
| examples/booking/app/controllers/hotels.go:168:33:168:40 | implicit dereference | Origin of readStep is missing a PostUpdateNode. |
| examples/booking/app/controllers/hotels.go:169:3:169:3 | implicit read of field Controller | Origin of readStep is missing a PostUpdateNode. |
| examples/booking/app/controllers/hotels.go:170:3:170:3 | c | Origin of readStep is missing a PostUpdateNode. |
| examples/booking/app/controllers/hotels.go:171:10:171:10 | c | Origin of readStep is missing a PostUpdateNode. |
| examples/booking/app/controllers/hotels.go:174:5:174:5 | implicit read of field Controller | Origin of readStep is missing a PostUpdateNode. |
| examples/booking/app/controllers/hotels.go:174:5:174:12 | implicit dereference | Origin of readStep is missing a PostUpdateNode. |
| examples/booking/app/controllers/hotels.go:175:3:175:3 | implicit read of field Controller | Origin of readStep is missing a PostUpdateNode. |
| examples/booking/app/controllers/hotels.go:176:4:176:10 | booking | Origin of readStep is missing a PostUpdateNode. |
| examples/booking/app/controllers/hotels.go:177:10:177:10 | c | Origin of readStep is missing a PostUpdateNode. |
| examples/booking/app/controllers/hotels.go:180:9:180:9 | c | Origin of readStep is missing a PostUpdateNode. |
| examples/booking/app/controllers/hotels.go:184:2:184:2 | implicit read of field Controller | Origin of readStep is missing a PostUpdateNode. |
| examples/booking/app/controllers/hotels.go:185:9:185:9 | c | Origin of readStep is missing a PostUpdateNode. |
| examples/booking/app/controllers/hotels.go:191:10:191:10 | c | Origin of readStep is missing a PostUpdateNode. |
| examples/booking/app/controllers/hotels.go:195:9:195:9 | c | Origin of readStep is missing a PostUpdateNode. |
| examples/booking/app/init.go:36:44:36:44 | implicit dereference | Origin of readStep is missing a PostUpdateNode. |
| examples/booking/app/init.go:40:49:40:49 | implicit dereference | Origin of readStep is missing a PostUpdateNode. |
| examples/booking/app/init.go:52:2:52:2 | implicit dereference | Origin of readStep is missing a PostUpdateNode. |