aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBernhard Schommer <bernhardschommer@gmail.com>2018-03-09 12:45:10 +0100
committerBernhard Schommer <bernhardschommer@gmail.com>2018-03-09 12:45:10 +0100
commit49bc45ed256f2d4d68ddab6868a2de06a67647be (patch)
tree8f0234e94ddaae9d21b682ce15f43c12ee3a6c0a
parent3f12f94bb84b796f764a2a0765048c17ab840ffb (diff)
downloadcompcert-kvx-49bc45ed256f2d4d68ddab6868a2de06a67647be.tar.gz
compcert-kvx-49bc45ed256f2d4d68ddab6868a2de06a67647be.zip
Do not transfer arguments for annotations.
In order to ensure that no transformation for arguments to builtin annotations are used, the original unchanged arguments are used. Bug 23179
-rw-r--r--cparser/StructPassing.ml7
1 files changed, 5 insertions, 2 deletions
diff --git a/cparser/StructPassing.ml b/cparser/StructPassing.ml
index e431d9f9..10aa6fd5 100644
--- a/cparser/StructPassing.ml
+++ b/cparser/StructPassing.ml
@@ -323,12 +323,15 @@ and transf_call env ctx opt_lhs fn args ty =
| None -> e
| Some lhs -> eassign lhs e in
match fn with
- | {edesc = EVar { C.name = "__builtin_va_arg"
- | "__builtin_annot"
+ | {edesc = EVar { C.name = "__builtin_annot"
| "__builtin_annot_intval"
| "__builtin_ais_annot" } } ->
(* Do not transform the call in this case, just use the default
pass-by-reference mode for struct/union arguments. *)
+ opt_eassign {edesc = ECall(fn, args); etyp = ty}
+ | {edesc = EVar { C.name = "__builtin_va_arg" } } ->
+ (* Do not transform the call in this case, just use the default
+ pass-by-reference mode for struct/union arguments. *)
opt_eassign {edesc = ECall(fn, args'); etyp = ty}
| _ ->
let call =