File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
c2rust-transpile/src/translator Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -446,7 +446,7 @@ impl<'c> Translation<'c> {
446
446
let assign_stmt = match op {
447
447
// Regular (possibly volatile) assignment
448
448
Assign if !is_volatile => WithStmts :: new_val ( mk ( ) . assign_expr ( write, rhs) ) ,
449
- Assign => WithStmts :: new_val ( self . volatile_write (
449
+ Assign => WithStmts :: new_unsafe_val ( self . volatile_write (
450
450
write,
451
451
initial_lhs_type_id,
452
452
rhs,
@@ -501,7 +501,7 @@ impl<'c> Translation<'c> {
501
501
502
502
let write = if is_volatile {
503
503
val. and_then ( |val| {
504
- TranslationResult :: Ok ( WithStmts :: new_val (
504
+ TranslationResult :: Ok ( WithStmts :: new_unsafe_val (
505
505
self . volatile_write ( write, initial_lhs_type_id, val) ?,
506
506
) )
507
507
} ) ?
@@ -887,6 +887,7 @@ impl<'c> Translation<'c> {
887
887
888
888
// *p = *p + rhs
889
889
let assign_stmt = if ty. qualifiers . is_volatile {
890
+ is_unsafe = true ;
890
891
self . volatile_write ( write, ty, val) ?
891
892
} else {
892
893
mk ( ) . assign_expr ( write, val)
You can’t perform that action at this time.
0 commit comments