File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -187,6 +187,12 @@ exprt string_set_char_builtin_functiont::length_constraint() const
187
187
equal_exprt (return_code, return_value));
188
188
}
189
189
190
+ static bool eval_is_upper_case (const mp_integer &c)
191
+ {
192
+ return (' A' <= c && c <= ' Z' ) || (0xc0 <= c && c <= 0xd6 ) ||
193
+ (0xd8 <= c && c <= 0xde );
194
+ }
195
+
190
196
optionalt<exprt> string_to_lower_case_builtin_functiont::eval (
191
197
const std::function<exprt(const exprt &)> &get_value) const
192
198
{
@@ -195,9 +201,7 @@ optionalt<exprt> string_to_lower_case_builtin_functiont::eval(
195
201
return {};
196
202
for (mp_integer &c : input_opt.value ())
197
203
{
198
- if (
199
- (' A' <= c && c <= ' Z' ) || (0xc0 <= c && c <= 0xd6 ) ||
200
- (0xd8 <= c && c <= 0xde ))
204
+ if (eval_is_upper_case (c))
201
205
c += 0x20 ;
202
206
}
203
207
const auto length =
@@ -214,7 +218,7 @@ optionalt<exprt> string_to_upper_case_builtin_functiont::eval(
214
218
return {};
215
219
for (mp_integer &c : input_opt.value ())
216
220
{
217
- if (' a ' <= c && c <= ' z ' )
221
+ if (eval_is_upper_case (c - 0x20 ) )
218
222
c -= 0x20 ;
219
223
}
220
224
const auto length =
You can’t perform that action at this time.
0 commit comments