Skip to content
/ otp Public
forked from erlang/otp

Commit

Permalink
dialyzer: Fix crash on formatting warning containing unicode text
Browse files Browse the repository at this point in the history
  • Loading branch information
jhogberg committed Apr 24, 2023
1 parent 17d5be4 commit fd2d11a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/dialyzer/src/dialyzer.erl
Original file line number Diff line number Diff line change
Expand Up @@ -415,8 +415,8 @@ message_to_string({app_call, [M, F, Args, Culprit, ExpectedType, FoundType]},
[M, F, a(Args, I), c(Culprit, I),
t(ExpectedType, I), t(FoundType, I)]);
message_to_string({bin_construction, [Culprit, Size, Seg, Type]}, I, _E) ->
io_lib:format("Binary construction will fail since the ~s field ~s in"
" segment ~s has type ~s\n",
io_lib:format("Binary construction will fail since the ~ts field ~ts in"
" segment ~ts has type ~ts\n",
[Culprit, c(Size, I), c(Seg, I), t(Type, I)]);
message_to_string({call, [M, F, Args, ArgNs, FailReason,
SigArgs, SigRet, Contract]}, I, _E) ->
Expand Down
3 changes: 3 additions & 0 deletions lib/dialyzer/test/small_SUITE_data/results/gh_7153
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

gh_7153.erl:4:1: Function t/1 has no local return
gh_7153.erl:5:7: Binary construction will fail since the value field X in segment X/utf8 has type '原子'
5 changes: 5 additions & 0 deletions lib/dialyzer/test/small_SUITE_data/src/gh_7153.erl
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-module(gh_7153).
-export([t/1]).

t(X = '原子') ->
<<X/utf8>>.

0 comments on commit fd2d11a

Please sign in to comment.