Print this page
new smatch
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/tools/smatch/src/smatch_function_hooks.c
+++ new/usr/src/tools/smatch/src/smatch_function_hooks.c
1 1 /*
2 2 * Copyright (C) 2009 Dan Carpenter.
3 3 *
4 4 * This program is free software; you can redistribute it and/or
5 5 * modify it under the terms of the GNU General Public License
6 6 * as published by the Free Software Foundation; either version 2
7 7 * of the License, or (at your option) any later version.
8 8 *
9 9 * This program is distributed in the hope that it will be useful,
10 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 12 * GNU General Public License for more details.
13 13 *
14 14 * You should have received a copy of the GNU General Public License
15 15 * along with this program; if not, see http://www.gnu.org/copyleft/gpl.txt
16 16 */
17 17
18 18 /*
19 19 * There are several types of function hooks:
20 20 * add_function_hook() - For any time a function is called.
21 21 * add_function_assign_hook() - foo = the_function().
22 22 * add_implied_return_hook() - Calculates the implied return value.
23 23 * add_macro_assign_hook() - foo = the_macro().
24 24 * return_implies_state() - For when a return value of 1 implies locked
25 25 * and 0 implies unlocked. etc. etc.
26 26 *
27 27 */
28 28
29 29 #include <stdlib.h>
30 30 #include <stdio.h>
31 31 #include "smatch.h"
32 32 #include "smatch_slist.h"
33 33 #include "smatch_extra.h"
34 34 #include "smatch_function_hashtable.h"
35 35
36 36 struct fcall_back {
37 37 int type;
38 38 struct data_range *range;
39 39 union {
40 40 func_hook *call_back;
41 41 implication_hook *ranged;
42 42 implied_return_hook *implied_return;
43 43 } u;
44 44 void *info;
45 45 };
46 46
47 47 ALLOCATOR(fcall_back, "call backs");
48 48 DECLARE_PTR_LIST(call_back_list, struct fcall_back);
49 49
50 50 DEFINE_FUNCTION_HASHTABLE_STATIC(callback, struct fcall_back, struct call_back_list);
51 51 static struct hashtable *func_hash;
52 52
53 53 int __in_fake_parameter_assign;
54 54
55 55 #define REGULAR_CALL 0
56 56 #define RANGED_CALL 1
57 57 #define ASSIGN_CALL 2
58 58 #define IMPLIED_RETURN 3
59 59 #define MACRO_ASSIGN 4
60 60 #define MACRO_ASSIGN_EXTRA 5
61 61
62 62 struct return_implies_callback {
63 63 int type;
64 64 return_implies_hook *callback;
65 65 };
66 66 ALLOCATOR(return_implies_callback, "return_implies callbacks");
67 67 DECLARE_PTR_LIST(db_implies_list, struct return_implies_callback);
68 68 static struct db_implies_list *db_return_states_list;
69 69
70 70 typedef void (void_fn)(void);
71 71 DECLARE_PTR_LIST(void_fn_list, void_fn *);
72 72 static struct void_fn_list *return_states_before;
73 73 static struct void_fn_list *return_states_after;
74 74
75 75 static struct fcall_back *alloc_fcall_back(int type, void *call_back,
76 76 void *info)
77 77 {
78 78 struct fcall_back *cb;
79 79
80 80 cb = __alloc_fcall_back(0);
81 81 cb->type = type;
82 82 cb->u.call_back = call_back;
83 83 cb->info = info;
84 84 return cb;
85 85 }
86 86
87 87 void add_function_hook(const char *look_for, func_hook *call_back, void *info)
88 88 {
89 89 struct fcall_back *cb;
90 90
91 91 cb = alloc_fcall_back(REGULAR_CALL, call_back, info);
92 92 add_callback(func_hash, look_for, cb);
93 93 }
94 94
95 95 void add_function_assign_hook(const char *look_for, func_hook *call_back,
96 96 void *info)
97 97 {
98 98 struct fcall_back *cb;
99 99
100 100 cb = alloc_fcall_back(ASSIGN_CALL, call_back, info);
101 101 add_callback(func_hash, look_for, cb);
102 102 }
103 103
104 104 void add_implied_return_hook(const char *look_for,
105 105 implied_return_hook *call_back,
106 106 void *info)
107 107 {
108 108 struct fcall_back *cb;
109 109
110 110 cb = alloc_fcall_back(IMPLIED_RETURN, call_back, info);
111 111 add_callback(func_hash, look_for, cb);
112 112 }
113 113
114 114 void add_macro_assign_hook(const char *look_for, func_hook *call_back,
115 115 void *info)
116 116 {
117 117 struct fcall_back *cb;
118 118
119 119 cb = alloc_fcall_back(MACRO_ASSIGN, call_back, info);
120 120 add_callback(func_hash, look_for, cb);
121 121 }
122 122
123 123 void add_macro_assign_hook_extra(const char *look_for, func_hook *call_back,
124 124 void *info)
125 125 {
126 126 struct fcall_back *cb;
127 127
128 128 cb = alloc_fcall_back(MACRO_ASSIGN_EXTRA, call_back, info);
129 129 add_callback(func_hash, look_for, cb);
130 130 }
131 131
132 132 void return_implies_state(const char *look_for, long long start, long long end,
133 133 implication_hook *call_back, void *info)
134 134 {
135 135 struct fcall_back *cb;
136 136
137 137 cb = alloc_fcall_back(RANGED_CALL, call_back, info);
138 138 cb->range = alloc_range_perm(ll_to_sval(start), ll_to_sval(end));
139 139 add_callback(func_hash, look_for, cb);
140 140 }
141 141
142 142 void return_implies_state_sval(const char *look_for, sval_t start, sval_t end,
143 143 implication_hook *call_back, void *info)
144 144 {
145 145 struct fcall_back *cb;
146 146
147 147 cb = alloc_fcall_back(RANGED_CALL, call_back, info);
148 148 cb->range = alloc_range_perm(start, end);
149 149 add_callback(func_hash, look_for, cb);
150 150 }
151 151
152 152 void select_return_states_hook(int type, return_implies_hook *callback)
153 153 {
154 154 struct return_implies_callback *cb = __alloc_return_implies_callback(0);
155 155
156 156 cb->type = type;
157 157 cb->callback = callback;
158 158 add_ptr_list(&db_return_states_list, cb);
159 159 }
160 160
161 161 void select_return_states_before(void_fn *fn)
162 162 {
163 163 void_fn **p = malloc(sizeof(void_fn *));
164 164 *p = fn;
165 165 add_ptr_list(&return_states_before, p);
166 166 }
167 167
168 168 void select_return_states_after(void_fn *fn)
169 169 {
170 170 void_fn **p = malloc(sizeof(void_fn *));
171 171 *p = fn;
172 172 add_ptr_list(&return_states_after, p);
173 173 }
174 174
175 175 static void call_return_states_before_hooks(void)
176 176 {
177 177 void_fn **fn;
178 178
179 179 FOR_EACH_PTR(return_states_before, fn) {
180 180 (*fn)();
181 181 } END_FOR_EACH_PTR(fn);
182 182 }
183 183
184 184 static void call_return_states_after_hooks(struct expression *expr)
185 185 {
186 186 void_fn **fn;
187 187
188 188 FOR_EACH_PTR(return_states_after, fn) {
189 189 (*fn)();
190 190 } END_FOR_EACH_PTR(fn);
191 191 __pass_to_client(expr, FUNCTION_CALL_HOOK_AFTER_DB);
192 192 }
193 193
194 194 static int call_call_backs(struct call_back_list *list, int type,
195 195 const char *fn, struct expression *expr)
196 196 {
197 197 struct fcall_back *tmp;
198 198 int handled = 0;
199 199
200 200 FOR_EACH_PTR(list, tmp) {
201 201 if (tmp->type == type) {
202 202 (tmp->u.call_back)(fn, expr, tmp->info);
203 203 handled = 1;
204 204 }
205 205 } END_FOR_EACH_PTR(tmp);
206 206
207 207 return handled;
208 208 }
209 209
210 210 static void call_ranged_call_backs(struct call_back_list *list,
211 211 const char *fn, struct expression *call_expr,
212 212 struct expression *assign_expr)
213 213 {
214 214 struct fcall_back *tmp;
215 215
216 216 FOR_EACH_PTR(list, tmp) {
217 217 (tmp->u.ranged)(fn, call_expr, assign_expr, tmp->info);
218 218 } END_FOR_EACH_PTR(tmp);
219 219 }
220 220
221 221 static struct call_back_list *get_same_ranged_call_backs(struct call_back_list *list,
222 222 struct data_range *drange)
223 223 {
224 224 struct call_back_list *ret = NULL;
225 225 struct fcall_back *tmp;
226 226
227 227 FOR_EACH_PTR(list, tmp) {
228 228 if (tmp->type != RANGED_CALL)
229 229 continue;
230 230 if (ranges_equiv(tmp->range, drange))
231 231 add_ptr_list(&ret, tmp);
232 232 } END_FOR_EACH_PTR(tmp);
233 233 return ret;
234 234 }
235 235
236 236 static int in_list_exact_sval(struct range_list *list, struct data_range *drange)
237 237 {
238 238 struct data_range *tmp;
239 239
240 240 FOR_EACH_PTR(list, tmp) {
241 241 if (ranges_equiv(tmp, drange))
242 242 return 1;
243 243 } END_FOR_EACH_PTR(tmp);
244 244 return 0;
245 245 }
246 246
247 247 static int assign_ranged_funcs(const char *fn, struct expression *expr,
248 248 struct call_back_list *call_backs)
249 249 {
250 250 struct fcall_back *tmp;
251 251 struct sm_state *sm;
252 252 char *var_name;
253 253 struct symbol *sym;
254 254 struct smatch_state *estate;
255 255 struct stree *tmp_stree;
256 256 struct stree *final_states = NULL;
257 257 struct range_list *handled_ranges = NULL;
258 258 struct call_back_list *same_range_call_backs = NULL;
259 259 struct range_list *rl;
260 260 int handled = 0;
261 261
262 262 if (!call_backs)
263 263 return 0;
264 264
265 265 var_name = expr_to_var_sym(expr->left, &sym);
266 266 if (!var_name || !sym)
267 267 goto free;
268 268
269 269 FOR_EACH_PTR(call_backs, tmp) {
270 270 if (tmp->type != RANGED_CALL)
271 271 continue;
272 272
273 273 if (in_list_exact_sval(handled_ranges, tmp->range))
274 274 continue;
275 275 __push_fake_cur_stree();
276 276 tack_on(&handled_ranges, tmp->range);
277 277
278 278 same_range_call_backs = get_same_ranged_call_backs(call_backs, tmp->range);
279 279 call_ranged_call_backs(same_range_call_backs, fn, expr->right, expr);
280 280 __free_ptr_list((struct ptr_list **)&same_range_call_backs);
281 281
282 282 rl = alloc_rl(tmp->range->min, tmp->range->max);
283 283 rl = cast_rl(get_type(expr->left), rl);
284 284 estate = alloc_estate_rl(rl);
285 285 set_extra_mod(var_name, sym, expr->left, estate);
286 286
287 287 tmp_stree = __pop_fake_cur_stree();
288 288 merge_fake_stree(&final_states, tmp_stree);
289 289 free_stree(&tmp_stree);
290 290 handled = 1;
291 291 } END_FOR_EACH_PTR(tmp);
292 292
293 293 FOR_EACH_SM(final_states, sm) {
294 294 __set_sm(sm);
295 295 } END_FOR_EACH_SM(sm);
296 296
297 297 free_stree(&final_states);
298 298 free:
299 299 free_string(var_name);
300 300 return handled;
301 301 }
302 302
303 303 static void call_implies_callbacks(int comparison, struct expression *expr, sval_t sval, int left, struct stree **implied_true, struct stree **implied_false)
304 304 {
305 305 struct call_back_list *call_backs;
306 306 struct fcall_back *tmp;
307 307 const char *fn;
308 308 struct data_range *value_range;
309 309 struct stree *true_states = NULL;
310 310 struct stree *false_states = NULL;
311 311 struct stree *tmp_stree;
312 312
313 313 *implied_true = NULL;
314 314 *implied_false = NULL;
315 315 if (expr->fn->type != EXPR_SYMBOL || !expr->fn->symbol)
316 316 return;
317 317 fn = expr->fn->symbol->ident->name;
318 318 call_backs = search_callback(func_hash, (char *)expr->fn->symbol->ident->name);
319 319 if (!call_backs)
320 320 return;
321 321 value_range = alloc_range(sval, sval);
322 322
323 323 /* set true states */
324 324 __push_fake_cur_stree();
325 325 FOR_EACH_PTR(call_backs, tmp) {
326 326 if (tmp->type != RANGED_CALL)
327 327 continue;
328 328 if (!true_comparison_range_LR(comparison, tmp->range, value_range, left))
329 329 continue;
330 330 (tmp->u.ranged)(fn, expr, NULL, tmp->info);
331 331 } END_FOR_EACH_PTR(tmp);
332 332 tmp_stree = __pop_fake_cur_stree();
333 333 merge_fake_stree(&true_states, tmp_stree);
334 334 free_stree(&tmp_stree);
335 335
336 336 /* set false states */
337 337 __push_fake_cur_stree();
338 338 FOR_EACH_PTR(call_backs, tmp) {
339 339 if (tmp->type != RANGED_CALL)
340 340 continue;
341 341 if (!false_comparison_range_LR(comparison, tmp->range, value_range, left))
342 342 continue;
343 343 (tmp->u.ranged)(fn, expr, NULL, tmp->info);
344 344 } END_FOR_EACH_PTR(tmp);
345 345 tmp_stree = __pop_fake_cur_stree();
346 346 merge_fake_stree(&false_states, tmp_stree);
347 347 free_stree(&tmp_stree);
348 348
349 349 *implied_true = true_states;
350 350 *implied_false = false_states;
351 351 }
352 352
353 353 struct db_callback_info {
354 354 int true_side;
355 355 int comparison;
356 356 struct expression *expr;
357 357 struct range_list *rl;
358 358 int left;
359 359 struct stree *stree;
360 360 struct db_implies_list *callbacks;
361 361 int prev_return_id;
362 362 int cull;
363 363 int has_states;
364 364 char *ret_str;
365 365 struct smatch_state *ret_state;
↓ open down ↓ |
365 lines elided |
↑ open up ↑ |
366 366 struct expression *var_expr;
367 367 int handled;
368 368 };
369 369
370 370 static void store_return_state(struct db_callback_info *db_info, const char *ret_str, struct smatch_state *state)
371 371 {
372 372 db_info->ret_str = alloc_sname(ret_str),
373 373 db_info->ret_state = state;
374 374 }
375 375
376 -static bool fake_a_param_assignment(struct expression *expr, const char *return_str)
376 +static bool fake_a_param_assignment(struct expression *expr, const char *return_str, struct smatch_state *orig)
377 377 {
378 378 struct expression *arg, *left, *right, *tmp, *fake_assign;
379 379 char *p;
380 380 int param;
381 381 char buf[256];
382 382 char *str;
383 383
384 384 if (expr->type != EXPR_ASSIGNMENT || expr->op != '=')
385 385 return false;
386 386 left = expr->left;
387 387 right = expr->right;
388 388
389 389 while (right->type == EXPR_ASSIGNMENT)
390 390 right = strip_expr(right->right);
391 391 if (!right || right->type != EXPR_CALL)
392 392 return false;
393 393
394 394 p = strchr(return_str, '[');
395 395 if (!p)
396 396 return false;
397 397
398 398 p++;
399 399 if (p[0] == '=' && p[1] == '=')
400 400 p += 2;
401 401 if (p[0] != '$')
402 402 return false;
403 403
404 404 snprintf(buf, sizeof(buf), "%s", p);
405 405
406 406 p = buf;
407 407 p += 1;
408 408 param = strtol(p, &p, 10);
409 409
410 410 p = strchr(p, ']');
411 411 if (!p || *p != ']')
412 412 return false;
413 413 *p = '\0';
414 414
415 415 arg = get_argument_from_call_expr(right->args, param);
416 416 if (!arg)
417 417 return false;
418 418
419 419 /* There should be a get_other_name() function which returns an expr */
420 420 tmp = get_assigned_expr(arg);
421 421 if (tmp)
422 422 arg = tmp;
423 423
424 424 /*
425 425 * This is a sanity check to prevent side effects from evaluating stuff
426 426 * twice.
427 427 */
428 428 str = expr_to_chunk_sym_vsl(arg, NULL, NULL);
429 429 if (!str)
↓ open down ↓ |
43 lines elided |
↑ open up ↑ |
430 430 return false;
431 431 free_string(str);
432 432
433 433 right = gen_expression_from_key(arg, buf);
434 434 if (!right) /* Mostly fails for binops like [$0 + 4032] */
435 435 return false;
436 436 fake_assign = assign_expression(left, '=', right);
437 437 __in_fake_parameter_assign++;
438 438 __split_expr(fake_assign);
439 439 __in_fake_parameter_assign--;
440 +
441 + /*
442 + * If the return is "0-65531[$0->nla_len - 4]" the faked expression
443 + * is maybe (-4)-65531 but we know it is in the 0-65531 range so both
444 + * parts have to be considered. We use _nomod() because it's not really
445 + * another modification, it's just a clarification.
446 + *
447 + */
448 + if (estate_rl(orig)) {
449 + struct smatch_state *faked;
450 + struct range_list *rl;
451 +
452 + faked = get_extra_state(left);
453 + if (estate_rl(faked)) {
454 + rl = rl_intersection(estate_rl(faked), estate_rl(orig));
455 + if (rl)
456 + set_extra_expr_nomod(expr, alloc_estate_rl(rl));
457 + }
458 + }
459 +
440 460 return true;
441 461 }
442 462
443 463 static void set_return_assign_state(struct db_callback_info *db_info)
444 464 {
445 465 struct expression *expr = db_info->expr->left;
446 466 struct smatch_state *state;
447 467
448 468 if (!db_info->ret_state)
449 469 return;
450 470
451 471 state = alloc_estate_rl(cast_rl(get_type(expr), clone_rl(estate_rl(db_info->ret_state))));
452 - set_extra_expr_mod(expr, state);
472 + if (!fake_a_param_assignment(db_info->expr, db_info->ret_str, state))
473 + set_extra_expr_mod(expr, state);
474 +
453 475 db_info->ret_state = NULL;
454 - fake_a_param_assignment(db_info->expr, db_info->ret_str);
455 476 db_info->ret_str = NULL;
456 477 }
457 478
458 479 static void set_other_side_state(struct db_callback_info *db_info)
459 480 {
460 481 struct expression *expr = db_info->var_expr;
461 482 struct smatch_state *state;
462 483
463 484 if (!db_info->ret_state)
464 485 return;
465 486
466 487 state = alloc_estate_rl(cast_rl(get_type(expr), clone_rl(estate_rl(db_info->ret_state))));
467 488 set_extra_expr_nomod(expr, state);
468 489 db_info->ret_state = NULL;
469 490 db_info->ret_str = NULL;
470 491 }
471 492
472 493 static void handle_ret_equals_param(char *ret_string, struct range_list *rl, struct expression *call)
473 494 {
474 495 char *str;
475 496 long long param;
476 497 struct expression *arg;
477 498 struct range_list *orig;
478 499
479 500 str = strstr(ret_string, "==$");
480 501 if (!str)
481 502 return;
482 503 str += 3;
483 504 param = strtoll(str, NULL, 10);
484 505 arg = get_argument_from_call_expr(call->args, param);
485 506 if (!arg)
486 507 return;
487 508 get_absolute_rl(arg, &orig);
488 509 rl = rl_intersection(orig, rl);
489 510 if (!rl)
490 511 return;
491 512 set_extra_expr_nomod(arg, alloc_estate_rl(rl));
492 513 }
493 514
494 515 static int impossible_limit(struct expression *expr, int param, char *key, char *value)
495 516 {
496 517 struct expression *arg;
497 518 struct smatch_state *state;
498 519 struct range_list *passed;
499 520 struct range_list *limit;
500 521 struct symbol *compare_type;
501 522
502 523 while (expr->type == EXPR_ASSIGNMENT)
503 524 expr = strip_expr(expr->right);
504 525 if (expr->type != EXPR_CALL)
505 526 return 0;
506 527
507 528 arg = get_argument_from_call_expr(expr->args, param);
508 529 if (!arg)
509 530 return 0;
510 531
511 532 if (strcmp(key, "$") == 0) {
512 533 if (!get_implied_rl(arg, &passed))
513 534 return 0;
514 535
515 536 compare_type = get_arg_type(expr->fn, param);
516 537 } else {
517 538 char *name;
518 539 struct symbol *sym;
519 540
520 541 name = get_variable_from_key(arg, key, &sym);
521 542 if (!name || !sym)
522 543 return 0;
523 544
524 545 state = get_state(SMATCH_EXTRA, name, sym);
525 546 if (!state) {
526 547 free_string(name);
527 548 return 0;
528 549 }
529 550 passed = estate_rl(state);
530 551 if (!passed || is_whole_rl(passed)) {
531 552 free_string(name);
532 553 return 0;
533 554 }
534 555
535 556 compare_type = get_member_type_from_key(arg, key);
536 557 }
537 558
538 559 passed = cast_rl(compare_type, passed);
539 560 call_results_to_rl(expr, compare_type, value, &limit);
540 561 if (!limit || is_whole_rl(limit))
541 562 return 0;
542 563 if (possibly_true_rl(passed, SPECIAL_EQUAL, limit))
543 564 return 0;
544 565 if (option_debug || local_debug)
545 566 sm_msg("impossible: %d '%s' limit '%s' == '%s'", param, key, show_rl(passed), value);
546 567 return 1;
547 568 }
548 569
549 570 static int is_impossible_data(int type, struct expression *expr, int param, char *key, char *value)
550 571 {
551 572 if (type == PARAM_LIMIT && impossible_limit(expr, param, key, value))
552 573 return 1;
553 574 if (type == COMPARE_LIMIT && param_compare_limit_is_impossible(expr, param, key, value)) {
554 575 if (local_debug)
555 576 sm_msg("param_compare_limit_is_impossible: %d %s %s", param, key, value);
556 577 return 1;
557 578 }
558 579 return 0;
559 580 }
560 581
561 582 static int func_type_mismatch(struct expression *expr, const char *value)
562 583 {
563 584 struct symbol *type;
564 585
565 586 /* This makes faking returns easier */
566 587 if (!value || value[0] == '\0')
567 588 return 0;
568 589
569 590 while (expr->type == EXPR_ASSIGNMENT)
570 591 expr = strip_expr(expr->right);
571 592
572 593 /*
573 594 * Short cut: We only care about function pointers that are struct
574 595 * members.
575 596 *
576 597 */
577 598 if (expr->fn->type == EXPR_SYMBOL)
578 599 return 0;
579 600
580 601 type = get_type(expr->fn);
581 602 if (!type)
582 603 return 0;
583 604 if (type->type == SYM_PTR)
584 605 type = get_real_base_type(type);
585 606
586 607 if (strcmp(type_to_str(type), value) == 0)
587 608 return 0;
588 609
589 610 return 1;
590 611 }
591 612
592 613 static int db_compare_callback(void *_info, int argc, char **argv, char **azColName)
593 614 {
594 615 struct db_callback_info *db_info = _info;
595 616 struct range_list *var_rl = db_info->rl;
596 617 struct range_list *ret_range;
597 618 int type, param;
598 619 char *ret_str, *key, *value;
599 620 struct return_implies_callback *tmp;
600 621 struct stree *stree;
601 622 int return_id;
602 623 int comparison;
603 624
604 625 if (argc != 6)
605 626 return 0;
606 627
607 628 return_id = atoi(argv[0]);
608 629 ret_str = argv[1];
609 630 type = atoi(argv[2]);
610 631 param = atoi(argv[3]);
611 632 key = argv[4];
612 633 value = argv[5];
613 634
614 635 db_info->has_states = 1;
615 636 if (db_info->prev_return_id != -1 && type == INTERNAL) {
616 637 set_other_side_state(db_info);
617 638 stree = __pop_fake_cur_stree();
618 639
619 640 if (!db_info->cull)
620 641 merge_fake_stree(&db_info->stree, stree);
621 642 free_stree(&stree);
622 643 __push_fake_cur_stree();
623 644 db_info->cull = 0;
624 645 }
625 646 db_info->prev_return_id = return_id;
626 647
627 648 if (type == INTERNAL && func_type_mismatch(db_info->expr, value))
628 649 db_info->cull = 1;
629 650 if (db_info->cull)
630 651 return 0;
631 652 if (type == CULL_PATH) {
632 653 db_info->cull = 1;
633 654 return 0;
634 655 }
635 656
636 657 if (is_impossible_data(type, db_info->expr, param, key, value)) {
637 658 db_info->cull = 1;
638 659 return 0;
639 660 }
640 661
641 662 call_results_to_rl(db_info->expr, get_type(strip_expr(db_info->expr)), ret_str, &ret_range);
642 663 ret_range = cast_rl(get_type(db_info->expr), ret_range);
643 664 if (!ret_range)
644 665 ret_range = alloc_whole_rl(get_type(db_info->expr));
645 666
646 667 comparison = db_info->comparison;
647 668 if (db_info->left)
648 669 comparison = flip_comparison(comparison);
649 670
650 671 if (db_info->true_side) {
651 672 if (!possibly_true_rl(var_rl, comparison, ret_range))
652 673 return 0;
653 674 if (type == PARAM_LIMIT)
654 675 param_limit_implications(db_info->expr, param, key, value);
655 676 filter_by_comparison(&var_rl, comparison, ret_range);
656 677 filter_by_comparison(&ret_range, flip_comparison(comparison), var_rl);
657 678 } else {
658 679 if (!possibly_false_rl(var_rl, comparison, ret_range))
659 680 return 0;
660 681 if (type == PARAM_LIMIT)
661 682 param_limit_implications(db_info->expr, param, key, value);
662 683 filter_by_comparison(&var_rl, negate_comparison(comparison), ret_range);
663 684 filter_by_comparison(&ret_range, flip_comparison(negate_comparison(comparison)), var_rl);
664 685 }
665 686
666 687 handle_ret_equals_param(ret_str, ret_range, db_info->expr);
667 688
668 689 if (type == INTERNAL) {
669 690 set_state(-1, "unnull_path", NULL, &true_state);
670 691 __add_return_comparison(strip_expr(db_info->expr), ret_str);
671 692 __add_return_to_param_mapping(db_info->expr, ret_str);
672 693 store_return_state(db_info, ret_str, alloc_estate_rl(clone_rl(var_rl)));
673 694 }
674 695
675 696 FOR_EACH_PTR(db_info->callbacks, tmp) {
676 697 if (tmp->type == type)
677 698 tmp->callback(db_info->expr, param, key, value);
678 699 } END_FOR_EACH_PTR(tmp);
679 700
680 701 return 0;
681 702 }
682 703
683 704 static void compare_db_return_states_callbacks(struct expression *left, int comparison, struct expression *right, struct stree *implied_true, struct stree *implied_false)
684 705 {
685 706 struct stree *orig_states;
686 707 struct stree *stree;
687 708 struct stree *true_states;
688 709 struct stree *false_states;
689 710 struct sm_state *sm;
690 711 struct db_callback_info db_info = {};
691 712 struct expression *var_expr;
692 713 struct expression *call_expr;
693 714 struct range_list *rl;
694 715 int call_on_left;
695 716
696 717 orig_states = clone_stree(__get_cur_stree());
697 718
698 719 /* legacy cruft. need to fix call_implies_callbacks(). */
699 720 call_on_left = 1;
700 721 call_expr = left;
701 722 var_expr = right;
702 723 if (left->type != EXPR_CALL) {
703 724 call_on_left = 0;
704 725 call_expr = right;
705 726 var_expr = left;
706 727 }
707 728
708 729 get_absolute_rl(var_expr, &rl);
709 730
710 731 db_info.comparison = comparison;
711 732 db_info.expr = call_expr;
712 733 db_info.rl = rl;
713 734 db_info.left = call_on_left;
714 735 db_info.callbacks = db_return_states_list;
715 736 db_info.var_expr = var_expr;
716 737
717 738 call_return_states_before_hooks();
718 739
719 740 db_info.true_side = 1;
720 741 db_info.stree = NULL;
721 742 db_info.prev_return_id = -1;
722 743 __push_fake_cur_stree();
723 744 sql_select_return_states("return_id, return, type, parameter, key, value",
724 745 call_expr, db_compare_callback, &db_info);
725 746 set_other_side_state(&db_info);
726 747 stree = __pop_fake_cur_stree();
727 748 if (!db_info.cull)
728 749 merge_fake_stree(&db_info.stree, stree);
729 750 free_stree(&stree);
730 751 true_states = db_info.stree;
731 752 if (!true_states && db_info.has_states) {
732 753 __push_fake_cur_stree();
733 754 set_path_impossible();
734 755 true_states = __pop_fake_cur_stree();
735 756 }
736 757
737 758 nullify_path();
738 759 __unnullify_path();
739 760 FOR_EACH_SM(orig_states, sm) {
740 761 __set_sm_cur_stree(sm);
741 762 } END_FOR_EACH_SM(sm);
742 763
743 764 db_info.true_side = 0;
744 765 db_info.stree = NULL;
745 766 db_info.prev_return_id = -1;
746 767 db_info.cull = 0;
747 768 __push_fake_cur_stree();
748 769 sql_select_return_states("return_id, return, type, parameter, key, value", call_expr,
749 770 db_compare_callback, &db_info);
750 771 set_other_side_state(&db_info);
751 772 stree = __pop_fake_cur_stree();
752 773 if (!db_info.cull)
753 774 merge_fake_stree(&db_info.stree, stree);
754 775 free_stree(&stree);
755 776 false_states = db_info.stree;
756 777 if (!false_states && db_info.has_states) {
757 778 __push_fake_cur_stree();
758 779 set_path_impossible();
759 780 false_states = __pop_fake_cur_stree();
760 781 }
761 782
762 783 nullify_path();
763 784 __unnullify_path();
764 785 FOR_EACH_SM(orig_states, sm) {
765 786 __set_sm_cur_stree(sm);
766 787 } END_FOR_EACH_SM(sm);
767 788
768 789 free_stree(&orig_states);
769 790
770 791 FOR_EACH_SM(true_states, sm) {
771 792 __set_true_false_sm(sm, NULL);
772 793 } END_FOR_EACH_SM(sm);
773 794 FOR_EACH_SM(false_states, sm) {
774 795 __set_true_false_sm(NULL, sm);
775 796 } END_FOR_EACH_SM(sm);
776 797
777 798 free_stree(&true_states);
778 799 free_stree(&false_states);
779 800
780 801 call_return_states_after_hooks(call_expr);
781 802
782 803 FOR_EACH_SM(implied_true, sm) {
783 804 __set_true_false_sm(sm, NULL);
784 805 } END_FOR_EACH_SM(sm);
785 806 FOR_EACH_SM(implied_false, sm) {
786 807 __set_true_false_sm(NULL, sm);
787 808 } END_FOR_EACH_SM(sm);
788 809 }
789 810
790 811 void function_comparison(struct expression *left, int comparison, struct expression *right)
791 812 {
792 813 struct expression *var_expr;
793 814 struct expression *call_expr;
794 815 struct stree *implied_true = NULL;
795 816 struct stree *implied_false = NULL;
796 817 struct range_list *rl;
797 818 sval_t sval;
798 819 int call_on_left;
799 820
800 821 if (unreachable())
801 822 return;
802 823
803 824 /* legacy cruft. need to fix call_implies_callbacks(). */
804 825 call_on_left = 1;
805 826 call_expr = left;
806 827 var_expr = right;
807 828 if (left->type != EXPR_CALL) {
808 829 call_on_left = 0;
809 830 call_expr = right;
810 831 var_expr = left;
811 832 }
812 833
813 834 get_absolute_rl(var_expr, &rl);
814 835
815 836 if (rl_to_sval(rl, &sval))
816 837 call_implies_callbacks(comparison, call_expr, sval, call_on_left, &implied_true, &implied_false);
817 838
818 839 compare_db_return_states_callbacks(left, comparison, right, implied_true, implied_false);
819 840 free_stree(&implied_true);
820 841 free_stree(&implied_false);
821 842 }
822 843
823 844 static void call_ranged_return_hooks(struct db_callback_info *db_info)
824 845 {
825 846 struct call_back_list *call_backs;
826 847 struct expression *expr;
827 848 struct fcall_back *tmp;
828 849 char *fn;
829 850
830 851 expr = strip_expr(db_info->expr);
831 852 while (expr->type == EXPR_ASSIGNMENT)
832 853 expr = strip_expr(expr->right);
833 854 if (expr->type != EXPR_CALL ||
834 855 expr->fn->type != EXPR_SYMBOL)
835 856 return;
836 857
837 858 fn = expr->fn->symbol_name->name;
838 859
839 860 call_backs = search_callback(func_hash, fn);
840 861 FOR_EACH_PTR(call_backs, tmp) {
841 862 struct range_list *range_rl;
842 863
843 864 if (tmp->type != RANGED_CALL)
844 865 continue;
845 866 range_rl = alloc_rl(tmp->range->min, tmp->range->max);
846 867 range_rl = cast_rl(estate_type(db_info->ret_state), range_rl);
847 868 if (possibly_true_rl(range_rl, SPECIAL_EQUAL, estate_rl(db_info->ret_state)))
848 869 (tmp->u.ranged)(fn, expr, db_info->expr, tmp->info);
849 870 } END_FOR_EACH_PTR(tmp);
850 871 }
851 872
852 873 static int db_assign_return_states_callback(void *_info, int argc, char **argv, char **azColName)
853 874 {
854 875 struct db_callback_info *db_info = _info;
855 876 struct range_list *ret_range;
856 877 int type, param;
857 878 char *ret_str, *key, *value;
858 879 struct return_implies_callback *tmp;
859 880 struct stree *stree;
860 881 int return_id;
861 882
862 883 if (argc != 6)
863 884 return 0;
864 885
865 886 return_id = atoi(argv[0]);
866 887 ret_str = argv[1];
867 888 type = atoi(argv[2]);
868 889 param = atoi(argv[3]);
869 890 key = argv[4];
870 891 value = argv[5];
871 892
872 893 if (db_info->prev_return_id != -1 && type == INTERNAL) {
873 894 call_ranged_return_hooks(db_info);
874 895 set_return_assign_state(db_info);
875 896 stree = __pop_fake_cur_stree();
876 897 if (!db_info->cull)
877 898 merge_fake_stree(&db_info->stree, stree);
878 899 free_stree(&stree);
879 900 __push_fake_cur_stree();
880 901 db_info->cull = 0;
881 902 }
882 903 db_info->prev_return_id = return_id;
883 904
884 905 if (type == INTERNAL && func_type_mismatch(db_info->expr, value))
885 906 db_info->cull = 1;
886 907 if (db_info->cull)
887 908 return 0;
888 909 if (type == CULL_PATH) {
889 910 db_info->cull = 1;
890 911 return 0;
891 912 }
892 913 if (is_impossible_data(type, db_info->expr, param, key, value)) {
893 914 db_info->cull = 1;
894 915 return 0;
895 916 }
896 917
897 918 if (type == PARAM_LIMIT)
898 919 param_limit_implications(db_info->expr, param, key, value);
899 920
900 921 db_info->handled = 1;
901 922 call_results_to_rl(db_info->expr->right, get_type(strip_expr(db_info->expr->right)), ret_str, &ret_range);
902 923 if (!ret_range)
903 924 ret_range = alloc_whole_rl(get_type(strip_expr(db_info->expr->right)));
904 925 ret_range = cast_rl(get_type(db_info->expr->right), ret_range);
905 926
906 927 if (type == INTERNAL) {
907 928 set_state(-1, "unnull_path", NULL, &true_state);
908 929 __add_return_comparison(strip_expr(db_info->expr->right), ret_str);
909 930 __add_comparison_info(db_info->expr->left, strip_expr(db_info->expr->right), ret_str);
910 931 __add_return_to_param_mapping(db_info->expr, ret_str);
911 932 store_return_state(db_info, ret_str, alloc_estate_rl(ret_range));
912 933 }
913 934
914 935 FOR_EACH_PTR(db_return_states_list, tmp) {
915 936 if (tmp->type == type)
916 937 tmp->callback(db_info->expr, param, key, value);
917 938 } END_FOR_EACH_PTR(tmp);
918 939
919 940 return 0;
920 941 }
921 942
922 943 static int db_return_states_assign(struct expression *expr)
923 944 {
924 945 struct expression *right;
925 946 struct sm_state *sm;
926 947 struct stree *stree;
927 948 struct db_callback_info db_info = {};
928 949
929 950 right = strip_expr(expr->right);
930 951
931 952 db_info.prev_return_id = -1;
932 953 db_info.expr = expr;
933 954 db_info.stree = NULL;
934 955 db_info.handled = 0;
935 956
936 957 call_return_states_before_hooks();
937 958
938 959 __push_fake_cur_stree();
939 960 sql_select_return_states("return_id, return, type, parameter, key, value",
940 961 right, db_assign_return_states_callback, &db_info);
941 962 if (option_debug) {
942 963 sm_msg("%s return_id %d return_ranges %s",
943 964 db_info.cull ? "culled" : "merging",
944 965 db_info.prev_return_id,
945 966 db_info.ret_state ? db_info.ret_state->name : "'<empty>'");
946 967 }
947 968 if (db_info.handled)
948 969 call_ranged_return_hooks(&db_info);
949 970 set_return_assign_state(&db_info);
950 971 stree = __pop_fake_cur_stree();
951 972 if (!db_info.cull)
952 973 merge_fake_stree(&db_info.stree, stree);
953 974 free_stree(&stree);
954 975
955 976 if (!db_info.stree && db_info.cull) { /* this means we culled everything */
956 977 set_extra_expr_mod(expr->left, alloc_estate_whole(get_type(expr->left)));
957 978 set_path_impossible();
958 979 }
959 980 FOR_EACH_SM(db_info.stree, sm) {
960 981 __set_sm(sm);
961 982 } END_FOR_EACH_SM(sm);
962 983
963 984 free_stree(&db_info.stree);
964 985 call_return_states_after_hooks(right);
965 986
966 987 return db_info.handled;
967 988 }
968 989
969 990 static int handle_implied_return(struct expression *expr)
970 991 {
971 992 struct range_list *rl;
972 993
973 994 if (!get_implied_return(expr->right, &rl))
974 995 return 0;
975 996 rl = cast_rl(get_type(expr->left), rl);
976 997 set_extra_expr_mod(expr->left, alloc_estate_rl(rl));
977 998 return 1;
978 999 }
979 1000
980 1001 static void match_assign_call(struct expression *expr)
981 1002 {
982 1003 struct call_back_list *call_backs;
983 1004 const char *fn;
984 1005 struct expression *right;
985 1006 int handled = 0;
986 1007 struct range_list *rl;
987 1008
988 1009 if (expr->op != '=')
989 1010 return;
990 1011
991 1012 right = strip_expr(expr->right);
992 1013 if (right->fn->type != EXPR_SYMBOL || !right->fn->symbol) {
993 1014 handled |= db_return_states_assign(expr);
994 1015 if (!handled)
995 1016 goto assigned_unknown;
996 1017 return;
997 1018 }
998 1019 if (is_fake_call(right)) {
999 1020 set_extra_expr_mod(expr->left, alloc_estate_whole(get_type(expr->left)));
1000 1021 return;
1001 1022 }
1002 1023
1003 1024 fn = right->fn->symbol->ident->name;
1004 1025 call_backs = search_callback(func_hash, (char *)fn);
1005 1026
1006 1027 /*
1007 1028 * The ordering here is sort of important.
1008 1029 * One example, of how this matters is that when we do:
1009 1030 *
1010 1031 * len = strlen(str);
1011 1032 *
1012 1033 * That is handled by smatch_common_functions.c and smatch_strlen.c.
1013 1034 * They use implied_return and function_assign_hook respectively.
1014 1035 * We want to get the implied return first before we do the function
1015 1036 * assignment hook otherwise we end up writing the wrong thing for len
1016 1037 * in smatch_extra.c because we assume that it already holds the
1017 1038 * strlen() when we haven't set it yet.
1018 1039 */
1019 1040
1020 1041 if (db_return_states_assign(expr) == 1)
1021 1042 handled = 1;
1022 1043 else
1023 1044 handled = assign_ranged_funcs(fn, expr, call_backs);
1024 1045 handled |= handle_implied_return(expr);
1025 1046
1026 1047
1027 1048 call_call_backs(call_backs, ASSIGN_CALL, fn, expr);
1028 1049
1029 1050 if (handled)
1030 1051 return;
1031 1052
1032 1053 assigned_unknown:
1033 1054 get_absolute_rl(expr->right, &rl);
1034 1055 rl = cast_rl(get_type(expr->left), rl);
1035 1056 set_extra_expr_mod(expr->left, alloc_estate_rl(rl));
1036 1057 }
1037 1058
1038 1059 static int db_return_states_callback(void *_info, int argc, char **argv, char **azColName)
1039 1060 {
1040 1061 struct db_callback_info *db_info = _info;
1041 1062 struct range_list *ret_range;
1042 1063 int type, param;
1043 1064 char *ret_str, *key, *value;
1044 1065 struct return_implies_callback *tmp;
1045 1066 struct stree *stree;
1046 1067 int return_id;
1047 1068 char buf[64];
1048 1069
1049 1070 if (argc != 6)
1050 1071 return 0;
1051 1072
1052 1073 return_id = atoi(argv[0]);
1053 1074 ret_str = argv[1];
1054 1075 type = atoi(argv[2]);
1055 1076 param = atoi(argv[3]);
1056 1077 key = argv[4];
1057 1078 value = argv[5];
1058 1079
1059 1080 if (db_info->prev_return_id != -1 && type == INTERNAL) {
1060 1081 stree = __pop_fake_cur_stree();
1061 1082 if (!db_info->cull)
1062 1083 merge_fake_stree(&db_info->stree, stree);
1063 1084 free_stree(&stree);
1064 1085 __push_fake_cur_stree();
1065 1086 __unnullify_path();
1066 1087 db_info->cull = 0;
1067 1088 }
1068 1089 db_info->prev_return_id = return_id;
1069 1090
1070 1091 if (type == INTERNAL && func_type_mismatch(db_info->expr, value))
1071 1092 db_info->cull = 1;
1072 1093 if (db_info->cull)
1073 1094 return 0;
1074 1095 if (type == CULL_PATH) {
1075 1096 db_info->cull = 1;
1076 1097 return 0;
1077 1098 }
1078 1099 if (is_impossible_data(type, db_info->expr, param, key, value)) {
1079 1100 db_info->cull = 1;
1080 1101 return 0;
1081 1102 }
1082 1103
1083 1104 if (type == PARAM_LIMIT)
1084 1105 param_limit_implications(db_info->expr, param, key, value);
↓ open down ↓ |
620 lines elided |
↑ open up ↑ |
1085 1106
1086 1107 call_results_to_rl(db_info->expr, get_type(strip_expr(db_info->expr)), ret_str, &ret_range);
1087 1108 ret_range = cast_rl(get_type(db_info->expr), ret_range);
1088 1109
1089 1110 if (type == INTERNAL) {
1090 1111 set_state(-1, "unnull_path", NULL, &true_state);
1091 1112 __add_return_comparison(strip_expr(db_info->expr), ret_str);
1092 1113 __add_return_to_param_mapping(db_info->expr, ret_str);
1093 1114 }
1094 1115
1095 -
1096 1116 FOR_EACH_PTR(db_return_states_list, tmp) {
1097 1117 if (tmp->type == type)
1098 1118 tmp->callback(db_info->expr, param, key, value);
1099 1119 } END_FOR_EACH_PTR(tmp);
1100 1120
1101 1121 /*
1102 1122 * We want to store the return values so that we can split the strees
1103 1123 * in smatch_db.c. This uses set_state() directly because it's not a
1104 1124 * real smatch_extra state.
1105 1125 */
1106 1126 snprintf(buf, sizeof(buf), "return %p", db_info->expr);
1107 1127 set_state(SMATCH_EXTRA, buf, NULL, alloc_estate_rl(ret_range));
1108 1128
1109 1129 return 0;
1110 1130 }
1111 1131
1112 1132 static void db_return_states(struct expression *expr)
1113 1133 {
1114 1134 struct sm_state *sm;
1115 1135 struct stree *stree;
1116 1136 struct db_callback_info db_info = {};
1117 1137
1118 1138 if (!__get_cur_stree()) /* no return functions */
1119 1139 return;
1120 1140
1121 1141 db_info.prev_return_id = -1;
1122 1142 db_info.expr = expr;
1123 1143 db_info.stree = NULL;
1124 1144
1125 1145 call_return_states_before_hooks();
1126 1146
1127 1147 __push_fake_cur_stree();
1128 1148 __unnullify_path();
1129 1149 sql_select_return_states("return_id, return, type, parameter, key, value",
1130 1150 expr, db_return_states_callback, &db_info);
1131 1151 stree = __pop_fake_cur_stree();
1132 1152 if (!db_info.cull)
1133 1153 merge_fake_stree(&db_info.stree, stree);
1134 1154 free_stree(&stree);
1135 1155
1136 1156 FOR_EACH_SM(db_info.stree, sm) {
1137 1157 __set_sm(sm);
1138 1158 } END_FOR_EACH_SM(sm);
1139 1159
1140 1160 free_stree(&db_info.stree);
1141 1161 call_return_states_after_hooks(expr);
1142 1162 }
1143 1163
1144 1164 static int is_condition_call(struct expression *expr)
1145 1165 {
1146 1166 struct expression *tmp;
1147 1167
1148 1168 FOR_EACH_PTR_REVERSE(big_condition_stack, tmp) {
1149 1169 if (expr == tmp || expr_get_parent_expr(expr) == tmp)
1150 1170 return 1;
1151 1171 if (tmp->pos.line < expr->pos.line)
1152 1172 return 0;
1153 1173 } END_FOR_EACH_PTR_REVERSE(tmp);
1154 1174
1155 1175 return 0;
1156 1176 }
1157 1177
1158 1178 static void db_return_states_call(struct expression *expr)
1159 1179 {
1160 1180 if (unreachable())
1161 1181 return;
1162 1182
↓ open down ↓ |
57 lines elided |
↑ open up ↑ |
1163 1183 if (is_assigned_call(expr))
1164 1184 return;
1165 1185 if (is_condition_call(expr))
1166 1186 return;
1167 1187 db_return_states(expr);
1168 1188 }
1169 1189
1170 1190 static void match_function_call(struct expression *expr)
1171 1191 {
1172 1192 struct call_back_list *call_backs;
1193 + struct expression *fn;
1173 1194
1174 - if (expr->fn->type == EXPR_SYMBOL && expr->fn->symbol) {
1175 - call_backs = search_callback(func_hash, (char *)expr->fn->symbol->ident->name);
1195 + fn = strip_expr(expr->fn);
1196 + if (fn->type == EXPR_SYMBOL && fn->symbol) {
1197 + call_backs = search_callback(func_hash, (char *)fn->symbol->ident->name);
1176 1198 if (call_backs)
1177 1199 call_call_backs(call_backs, REGULAR_CALL,
1178 - expr->fn->symbol->ident->name, expr);
1200 + fn->symbol->ident->name, expr);
1179 1201 }
1180 1202 db_return_states_call(expr);
1181 1203 }
1182 1204
1183 1205 static void match_macro_assign(struct expression *expr)
1184 1206 {
1185 1207 struct call_back_list *call_backs;
1186 1208 const char *macro;
1187 1209 struct expression *right;
1188 1210
1189 1211 right = strip_expr(expr->right);
1190 1212 macro = get_macro_name(right->pos);
1191 1213 call_backs = search_callback(func_hash, (char *)macro);
1192 1214 if (!call_backs)
1193 1215 return;
1194 1216 call_call_backs(call_backs, MACRO_ASSIGN, macro, expr);
1195 1217 call_call_backs(call_backs, MACRO_ASSIGN_EXTRA, macro, expr);
1196 1218 }
1197 1219
1198 1220 int get_implied_return(struct expression *expr, struct range_list **rl)
1199 1221 {
1200 1222 struct call_back_list *call_backs;
1201 1223 struct fcall_back *tmp;
1202 1224 int handled = 0;
1203 1225 char *fn;
1204 1226
1205 1227 *rl = NULL;
1206 1228
1207 1229 expr = strip_expr(expr);
1208 1230 fn = expr_to_var(expr->fn);
1209 1231 if (!fn)
1210 1232 goto out;
1211 1233
1212 1234 call_backs = search_callback(func_hash, fn);
1213 1235
1214 1236 FOR_EACH_PTR(call_backs, tmp) {
1215 1237 if (tmp->type == IMPLIED_RETURN) {
1216 1238 (tmp->u.implied_return)(expr, tmp->info, rl);
1217 1239 handled = 1;
1218 1240 }
1219 1241 } END_FOR_EACH_PTR(tmp);
1220 1242
1221 1243 out:
1222 1244 free_string(fn);
1223 1245 return handled;
1224 1246 }
1225 1247
1226 1248 void create_function_hook_hash(void)
1227 1249 {
1228 1250 func_hash = create_function_hashtable(5000);
1229 1251 }
1230 1252
1231 1253 void register_function_hooks(int id)
1232 1254 {
1233 1255 add_hook(&match_function_call, CALL_HOOK_AFTER_INLINE);
1234 1256 add_hook(&match_assign_call, CALL_ASSIGNMENT_HOOK);
1235 1257 add_hook(&match_macro_assign, MACRO_ASSIGNMENT_HOOK);
1236 1258 }
↓ open down ↓ |
48 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX