Skip to content

Commit 18f9079

Browse files
committed
Type consistent string preprocessing for floating-point expressions
While the test was previously marked THOROUGH it would actually fail with warning: ignoring <= * type: bool 0: constant * type: floatbv * width: 64 * f: 52 * value: 0100000001000000101010101001111110111110011101101100100010110100 * #source_location: * file: StringValueOf09.java * line: 5 * function: java::StringValueOf09.main:([Ljava/lang/String;)V * java_bytecode_index: 1 1: constant * type: floatbv * width: 32 * f: 23 * value: 10111010100000110001001001101111 and similar warnings as double- and single-precision values got mixed up.
1 parent a61ea38 commit 18f9079

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

regression/jbmc-strings/StringValueOf09/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
THOROUGH
1+
CORE
22
StringValueOf09.class
33
--refine-strings --string-max-length 1000
44
^EXIT=10$

src/java_bytecode/java_string_library_preprocess.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -971,7 +971,7 @@ codet java_string_library_preprocesst::make_float_to_string_code(
971971
exprt str=allocate_fresh_string(type.return_type(), loc, symbol_table, code);
972972

973973
// Expression representing 0.0
974-
ieee_float_spect float_spec=ieee_float_spect::single_precision();
974+
ieee_float_spect float_spec(to_floatbv_type(params[0].type()));
975975
ieee_floatt zero_float(float_spec);
976976
zero_float.from_float(0.0);
977977
constant_exprt zero=zero_float.to_expr();

0 commit comments

Comments
 (0)