Skip to content

Commit

Permalink
Do not scrape const modifier on char pointers corresponding to strings
Browse files Browse the repository at this point in the history
Follow-up to d5d11eb.
  • Loading branch information
xavierleroy committed Nov 9, 2022
1 parent 761a29f commit 9437be3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion compiler/cvttyp.ml
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,10 @@ let rec scrape_type = function
(* Remove leading "const" from a type *)
let rec scrape_const = function
Type_const ty -> scrape_const ty
| Type_array(attr, ty) -> Type_array(attr, scrape_const ty)
| Type_array(attr, tyelt) as ty ->
if (attr.is_string || attr.is_bytes) && attr.bound = None
then ty
else Type_array(attr, scrape_const tyelt)
| ty -> ty

(* Determine if a type is an ignored pointer *)
Expand Down

0 comments on commit 9437be3

Please sign in to comment.