@@ -391,6 +391,14 @@ let condition_assigning_visitor
391
391
end
392
392
in
393
393
394
+ let raise_dst_init_precond_if_writing_through sid lval =
395
+ match lval with
396
+ Ast. LVAL_base _ -> ()
397
+ | Ast. LVAL_ext _ ->
398
+ let precond = slot_inits (lval_slots cx lval) in
399
+ raise_precondition sid precond;
400
+ in
401
+
394
402
let visit_stmt_pre s =
395
403
begin
396
404
match s.node with
@@ -402,6 +410,7 @@ let condition_assigning_visitor
402
410
let precond = slot_inits (lval_slots cx src) in
403
411
let postcond = slot_inits (lval_slots cx dst) in
404
412
raise_pre_post_cond s.id precond;
413
+ raise_dst_init_precond_if_writing_through s.id dst;
405
414
raise_postcondition s.id postcond
406
415
407
416
| Ast. STMT_send (dst , src ) ->
@@ -423,6 +432,7 @@ let condition_assigning_visitor
423
432
(Array. append (rec_inputs_slots cx entries) base_slots)
424
433
in
425
434
let postcond = slot_inits (lval_slots cx dst) in
435
+ raise_dst_init_precond_if_writing_through s.id dst;
426
436
raise_pre_post_cond s.id precond;
427
437
raise_postcondition s.id postcond
428
438
@@ -431,38 +441,45 @@ let condition_assigning_visitor
431
441
(tup_inputs_slots cx modes_atoms)
432
442
in
433
443
let postcond = slot_inits (lval_slots cx dst) in
444
+ raise_dst_init_precond_if_writing_through s.id dst;
434
445
raise_pre_post_cond s.id precond;
435
446
raise_postcondition s.id postcond
436
447
437
448
| Ast. STMT_new_vec (dst , _ , atoms ) ->
438
449
let precond = slot_inits (atoms_slots cx atoms) in
439
450
let postcond = slot_inits (lval_slots cx dst) in
451
+ raise_dst_init_precond_if_writing_through s.id dst;
440
452
raise_pre_post_cond s.id precond;
441
453
raise_postcondition s.id postcond
442
454
443
455
| Ast. STMT_new_str (dst , _ ) ->
444
456
let postcond = slot_inits (lval_slots cx dst) in
457
+ raise_dst_init_precond_if_writing_through s.id dst;
445
458
raise_postcondition s.id postcond
446
459
447
460
| Ast. STMT_new_port dst ->
448
461
let postcond = slot_inits (lval_slots cx dst) in
462
+ raise_dst_init_precond_if_writing_through s.id dst;
449
463
raise_postcondition s.id postcond
450
464
451
465
| Ast. STMT_new_chan (dst , port ) ->
452
466
let precond = slot_inits (lval_option_slots cx port) in
453
467
let postcond = slot_inits (lval_slots cx dst) in
468
+ raise_dst_init_precond_if_writing_through s.id dst;
454
469
raise_pre_post_cond s.id precond;
455
470
raise_postcondition s.id postcond
456
471
457
472
| Ast. STMT_new_box (dst , _ , src ) ->
458
473
let precond = slot_inits (atom_slots cx src) in
459
474
let postcond = slot_inits (lval_slots cx dst) in
475
+ raise_dst_init_precond_if_writing_through s.id dst;
460
476
raise_pre_post_cond s.id precond;
461
477
raise_postcondition s.id postcond
462
478
463
479
| Ast. STMT_copy (dst , src ) ->
464
480
let precond = slot_inits (expr_slots cx src) in
465
481
let postcond = slot_inits (lval_slots cx dst) in
482
+ raise_dst_init_precond_if_writing_through s.id dst;
466
483
raise_pre_post_cond s.id precond;
467
484
raise_postcondition s.id postcond
468
485
@@ -474,11 +491,13 @@ let condition_assigning_visitor
474
491
475
492
| Ast. STMT_spawn (dst, _, lv, args)
476
493
| Ast. STMT_call (dst , lv , args ) ->
494
+ raise_dst_init_precond_if_writing_through s.id dst;
477
495
visit_callable_pre s.id (lval_slots cx dst) lv args
478
496
479
497
| Ast. STMT_bind (dst , lv , args_opt ) ->
480
498
let args = arr_map_partial args_opt (fun a -> a) in
481
- visit_callable_pre s.id (lval_slots cx dst) lv args
499
+ raise_dst_init_precond_if_writing_through s.id dst;
500
+ visit_callable_pre s.id (lval_slots cx dst) lv args
482
501
483
502
| Ast. STMT_ret (Some at ) ->
484
503
let precond = slot_inits (atom_slots cx at) in
0 commit comments