^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) // SPDX-License-Identifier: GPL-2.0-only
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) ///
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) /// A variable is dereferenced under a NULL test.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) /// Even though it is known to be NULL.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) ///
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) // Confidence: Moderate
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) // Copyright: (C) 2010 Nicolas Palix, DIKU.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) // Copyright: (C) 2010 Julia Lawall, DIKU.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) // Copyright: (C) 2010 Gilles Muller, INRIA/LiP6.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) // URL: http://coccinelle.lip6.fr/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) // Comments: -I ... -all_includes can give more complete results
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) // Options:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) virtual context
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) virtual org
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) virtual report
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) // The following two rules are separate, because both can match a single
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) // expression in different ways
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) @pr1 expression@
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) expression E;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) identifier f;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) position p1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) @@
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) (E != NULL && ...) ? <+...E->f@p1...+> : ...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) @pr2 expression@
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) expression E;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) identifier f;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) position p2;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) @@
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) (
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) (E != NULL) && ... && <+...E->f@p2...+>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) (E == NULL) || ... || <+...E->f@p2...+>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) sizeof(<+...E->f@p2...+>)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) @ifm@
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) expression *E;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) statement S1,S2;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) position p1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) @@
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) if@p1 ((E == NULL && ...) || ...) S1 else S2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) // For org and report modes
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) @r depends on !context && (org || report) exists@
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) expression subE <= ifm.E;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) expression *ifm.E;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) expression E1,E2;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) identifier f;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) statement S1,S2,S3,S4;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) iterator iter;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) position p!={pr1.p1,pr2.p2};
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) position ifm.p1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) @@
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) if@p1 ((E == NULL && ...) || ...)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) ... when != if (...) S1 else S2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) (
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) iter(subE,...) S4 // no use
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) list_remove_head(E2,subE,...)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) subE = E1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) for(subE = E1;...;...) S4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) subE++
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) ++subE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) --subE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) subE--
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) &subE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) E->f@p // bad use
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87) ... when any
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) return ...;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90) else S3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92) @script:python depends on !context && !org && report@
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93) p << r.p;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) p1 << ifm.p1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95) x << ifm.E;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96) @@
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98) msg="ERROR: %s is NULL but dereferenced." % (x)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99) coccilib.report.print_report(p[0], msg)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) cocci.include_match(False)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) @script:python depends on !context && org && !report@
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) p << r.p;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) p1 << ifm.p1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) x << ifm.E;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) @@
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) msg="ERROR: %s is NULL but dereferenced." % (x)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) msg_safe=msg.replace("[","@(").replace("]",")")
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) cocci.print_main(msg_safe,p)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) cocci.include_match(False)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) @s depends on !context && (org || report) exists@
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) expression subE <= ifm.E;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) expression *ifm.E;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) expression E1,E2;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) identifier f;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) statement S1,S2,S3,S4;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) iterator iter;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) position p!={pr1.p1,pr2.p2};
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) position ifm.p1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) @@
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) if@p1 ((E == NULL && ...) || ...)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) ... when != if (...) S1 else S2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) (
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) iter(subE,...) S4 // no use
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) list_remove_head(E2,subE,...)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) subE = E1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) for(subE = E1;...;...) S4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) subE++
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) ++subE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) --subE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) subE--
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) &subE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) E->f@p // bad use
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) ... when any
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) else S3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) @script:python depends on !context && !org && report@
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) p << s.p;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) p1 << ifm.p1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) x << ifm.E;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) @@
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) msg="ERROR: %s is NULL but dereferenced." % (x)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) coccilib.report.print_report(p[0], msg)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) @script:python depends on !context && org && !report@
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) p << s.p;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) p1 << ifm.p1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) x << ifm.E;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) @@
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) msg="ERROR: %s is NULL but dereferenced." % (x)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) msg_safe=msg.replace("[","@(").replace("]",")")
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) cocci.print_main(msg_safe,p)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) // For context mode
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) @depends on context && !org && !report exists@
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) expression subE <= ifm.E;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) expression *ifm.E;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) expression E1,E2;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) identifier f;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) statement S1,S2,S3,S4;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) iterator iter;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) position p!={pr1.p1,pr2.p2};
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) position ifm.p1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) @@
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) if@p1 ((E == NULL && ...) || ...)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) ... when != if (...) S1 else S2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) (
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) iter(subE,...) S4 // no use
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) list_remove_head(E2,subE,...)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) subE = E1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) for(subE = E1;...;...) S4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) subE++
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) ++subE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) --subE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) subE--
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) &subE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) * E->f@p // bad use
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) ... when any
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) return ...;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) else S3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) // The following three rules are duplicates of ifm, pr1 and pr2 respectively.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) // It is need because the previous rule as already made a "change".
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) @pr11 depends on context && !org && !report expression@
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) expression E;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) identifier f;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) position p1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) @@
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) (E != NULL && ...) ? <+...E->f@p1...+> : ...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) @pr12 depends on context && !org && !report expression@
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) expression E;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) identifier f;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) position p2;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) @@
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) (
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) (E != NULL) && ... && <+...E->f@p2...+>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) (E == NULL) || ... || <+...E->f@p2...+>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) sizeof(<+...E->f@p2...+>)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) @ifm1 depends on context && !org && !report@
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) expression *E;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) statement S1,S2;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) position p1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) @@
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244) if@p1 ((E == NULL && ...) || ...) S1 else S2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246) @depends on context && !org && !report exists@
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247) expression subE <= ifm1.E;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248) expression *ifm1.E;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249) expression E1,E2;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250) identifier f;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251) statement S1,S2,S3,S4;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252) iterator iter;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253) position p!={pr11.p1,pr12.p2};
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254) position ifm1.p1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255) @@
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257) if@p1 ((E == NULL && ...) || ...)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 259) ... when != if (...) S1 else S2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 260) (
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 261) iter(subE,...) S4 // no use
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 262) |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 263) list_remove_head(E2,subE,...)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 264) |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 265) subE = E1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 266) |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 267) for(subE = E1;...;...) S4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 268) |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 269) subE++
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 270) |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 271) ++subE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 272) |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 273) --subE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 274) |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 275) subE--
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 276) |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 277) &subE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 278) |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 279) * E->f@p // bad use
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 280) )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 281) ... when any
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 282) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 283) else S3