Skip to content

Commit eec51ee

Browse files
dulmarodfacebook-github-bot
authored andcommitted
[llvm] Remove the last character from the constant strings
Summary: Llvm strings end in `\000` or something similar. We remove it to get the normal string. Reviewed By: ngorogiannis Differential Revision: D73774212 fbshipit-source-id: 9adbb615c7c48f8b246e2df3620aced3d4e1daed
1 parent 2e04d80 commit eec51ee

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

infer/src/sledge/llair/llairExp.ml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,9 @@ module T = struct
9090
raise_notrace (Invalid_argument "not a string") )
9191
with
9292
| str ->
93-
(*TODO: remove the \000 suffix*)
94-
Some str
93+
let len = String.length str - 1 in
94+
let new_str = String.sub str ~pos:0 ~len in
95+
Some new_str
9596
| exception _ ->
9697
None )
9798
| _ ->
-4 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)