Skip to content

Commit 6914845

Browse files
committed
Also unify static assert field strings in patch
1 parent e36524a commit 6914845

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

src/frontc/patch.ml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,8 @@ begin
565565
(unifySpecifiers spec1 spec2) @
566566
(unifyList list1 list2 unifyNameExprOpt)
567567
| FIELD_STATIC_ASSERT (exp1, str1, l1), FIELD_STATIC_ASSERT (exp2, str2, l2) ->
568-
(unifyExpr exp1 exp2)
568+
(unifyExpr exp1 exp2) @
569+
(unifyStringOpt str1 str2)
569570
| _, _ ->
570571
if verbose then (trace "patchDebug" (dprintf "mismatching struct_decl-s\n"));
571572
raise NoMatch
@@ -705,6 +706,15 @@ begin
705706
)
706707
end
707708

709+
and unifyStringOpt (pat : string option)
710+
(tgt : string option) : binding list =
711+
begin
712+
match pat,tgt with
713+
| None, None -> []
714+
| Some str1, Some str2 -> unifyString str1 str2
715+
| _,_ -> raise NoMatch
716+
end
717+
708718
and unifyExpr (pat : expression) (tgt : expression) : binding list =
709719
begin
710720
(* if they're equal, that's good enough *)

0 commit comments

Comments
 (0)