Skip to content

Commit 4d664d8

Browse files
RemyCiterindiaolo01
authored andcommitted
add guard for pac(...) syntax
1 parent e3dd2f3 commit 4d664d8

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

litmus/preSi.ml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1642,8 +1642,12 @@ module Make
16421642
Warn.fatal "Vector used as scalar"
16431643
| ConcreteRecord _ ->
16441644
Warn.fatal "Record used as scalar"
1645-
| Symbolic (Virtual a) when not (PAC.is_canonical a.pac) ->
1646-
Warn.user_error "Litmus cannot initialize a virtual address with a non-canonical PAC field"
1645+
| Symbolic (Virtual {name=s; tag=None; offset=0; pac; _})
1646+
when not (PAC.is_canonical pac) ->
1647+
if pauth1 || pauth2 then
1648+
sprintf "(%s)%s" (CType.dump at) (PAC.pp_litmus pac ("_vars->" ^ (Symbol.pp s)))
1649+
else
1650+
Warn.user_error "\"pauth1\" or \"pauth2\" must be set to support to use pac(...) notation"
16471651
| Symbolic (Virtual {name=Constant.Symbol.Label(p,lbl);_}) ->
16481652
sprintf "_vars->labels.%s" (OutUtils.fmt_lbl_var p lbl)
16491653
| Symbolic (Virtual {name=s; tag=None; offset=0; _}) ->

0 commit comments

Comments
 (0)