@@ -306,7 +306,7 @@ Function: character_refine_preprocesst::convert_for_digit
306
306
target - a position in a goto program
307
307
308
308
Purpose: Converts function call to an assignment of an expression
309
- corresponding to the java method Character.forDigit:(II)I
309
+ corresponding to the java method Character.forDigit:(II)C
310
310
311
311
TODO: For now the radix argument is ignored
312
312
@@ -319,11 +319,12 @@ codet character_refine_preprocesst::convert_for_digit(conversion_inputt &target)
319
319
const exprt &digit=function_call.arguments ()[0 ];
320
320
const exprt &result=function_call.lhs ();
321
321
const typet &type=result.type ();
322
+ typecast_exprt casted_digit (digit, type);
322
323
323
324
exprt d10=from_integer (10 , type);
324
- binary_relation_exprt small (digit , ID_le, d10);
325
- plus_exprt value1 (digit , from_integer (' 0' , type));
326
- minus_exprt value2 (plus_exprt (digit, from_integer (' a' , digit. type ())), d10 );
325
+ binary_relation_exprt small (casted_digit , ID_le, d10);
326
+ plus_exprt value1 (casted_digit , from_integer (' 0' , type));
327
+ plus_exprt value2 (minus_exprt (casted_digit, d10), from_integer (' a' , type) );
327
328
return code_assignt (result, if_exprt (small, value1, value2));
328
329
}
329
330
0 commit comments