Skip to content

Commit b59ebae

Browse files
RemyCiterindiaolo01
authored andcommitted
add guard for pac(...) syntax
1 parent 1121df5 commit b59ebae

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
@@ -1670,8 +1670,12 @@ module Make
16701670
Warn.fatal "Vector used as scalar"
16711671
| ConcreteRecord _ ->
16721672
Warn.fatal "Record used as scalar"
1673-
| Symbolic (Virtual a) when not (PAC.is_canonical a.pac) ->
1674-
Warn.user_error "Litmus cannot initialize a virtual address with a non-canonical PAC field"
1673+
| Symbolic (Virtual {name=s; tag=None; offset=0; pac; _})
1674+
when not (PAC.is_canonical pac) ->
1675+
if pauth1 || pauth2 then
1676+
sprintf "(%s)%s" (CType.dump at) (PAC.pp_litmus pac ("_vars->" ^ (Symbol.pp s)))
1677+
else
1678+
Warn.user_error "\"pauth1\" or \"pauth2\" must be set to support to use pac(...) notation"
16751679
| Symbolic (Virtual {name=Constant.Symbol.Label(p,lbl);_}) ->
16761680
sprintf "_vars->labels.%s" (OutUtils.fmt_lbl_var p lbl)
16771681
| Symbolic (Virtual {name=s; tag=None; offset=0; _}) ->

0 commit comments

Comments
 (0)