@@ -68,8 +68,10 @@ class java_bytecode_parsert final : public parsert
68
68
{
69
69
if (index==0 || index>=constant_pool.size ())
70
70
{
71
- error () << " invalid constant pool index (" << index << " )" << eom;
72
- error () << " constant pool size: " << constant_pool.size () << eom;
71
+ log.error () << " invalid constant pool index (" << index << " )"
72
+ << messaget::eom;
73
+ log.error () << " constant pool size: " << constant_pool.size ()
74
+ << messaget::eom;
73
75
throw 0 ;
74
76
}
75
77
@@ -119,7 +121,7 @@ class java_bytecode_parsert final : public parsert
119
121
{
120
122
if (!*in)
121
123
{
122
- error () << " unexpected end of bytecode file" << eom;
124
+ log. error () << " unexpected end of bytecode file" << messaget:: eom;
123
125
throw 0 ;
124
126
}
125
127
in->get ();
@@ -137,7 +139,7 @@ class java_bytecode_parsert final : public parsert
137
139
{
138
140
if (!*in)
139
141
{
140
- error () << " unexpected end of bytecode file" << eom;
142
+ log. error () << " unexpected end of bytecode file" << messaget:: eom;
141
143
throw 0 ;
142
144
}
143
145
result <<= 8u ;
@@ -386,19 +388,19 @@ bool java_bytecode_parsert::parse()
386
388
387
389
catch (const char *message)
388
390
{
389
- error () << message << eom;
391
+ log. error () << message << messaget:: eom;
390
392
return true ;
391
393
}
392
394
393
395
catch (const std::string &message)
394
396
{
395
- error () << message << eom;
397
+ log. error () << message << messaget:: eom;
396
398
return true ;
397
399
}
398
400
399
401
catch (...)
400
402
{
401
- error () << " parsing error" << eom;
403
+ log. error () << " parsing error" << messaget:: eom;
402
404
return true ;
403
405
}
404
406
@@ -437,13 +439,13 @@ void java_bytecode_parsert::rClassFile()
437
439
438
440
if (magic!=0xCAFEBABE )
439
441
{
440
- error () << " wrong magic" << eom;
442
+ log. error () << " wrong magic" << messaget:: eom;
441
443
throw 0 ;
442
444
}
443
445
444
446
if (major_version<44 )
445
447
{
446
- error () << " unexpected major version" << eom;
448
+ log. error () << " unexpected major version" << messaget:: eom;
447
449
throw 0 ;
448
450
}
449
451
@@ -643,7 +645,7 @@ void java_bytecode_parsert::rconstant_pool()
643
645
const u2 constant_pool_count = read<u2>();
644
646
if (constant_pool_count==0 )
645
647
{
646
- error () << " invalid constant_pool_count" << eom;
648
+ log. error () << " invalid constant_pool_count" << messaget:: eom;
647
649
throw 0 ;
648
650
}
649
651
@@ -685,7 +687,7 @@ void java_bytecode_parsert::rconstant_pool()
685
687
// Eight-byte constants take up two entries in the constant_pool table.
686
688
if (it==constant_pool.end ())
687
689
{
688
- error () << " invalid double entry" << eom;
690
+ log. error () << " invalid double entry" << messaget:: eom;
689
691
throw 0 ;
690
692
}
691
693
it++;
@@ -709,8 +711,8 @@ void java_bytecode_parsert::rconstant_pool()
709
711
break ;
710
712
711
713
default :
712
- error () << " unknown constant pool entry (" << it->tag << " )"
713
- << eom;
714
+ log. error () << " unknown constant pool entry (" << it->tag << " )"
715
+ << messaget:: eom;
714
716
throw 0 ;
715
717
}
716
718
}
@@ -1142,7 +1144,7 @@ void java_bytecode_parsert::rbytecode(std::vector<instructiont> &instructions)
1142
1144
1143
1145
if (address!=code_length)
1144
1146
{
1145
- error () << " bytecode length mismatch" << eom;
1147
+ log. error () << " bytecode length mismatch" << messaget:: eom;
1146
1148
throw 0 ;
1147
1149
}
1148
1150
}
@@ -1811,7 +1813,7 @@ optionalt<java_bytecode_parse_treet> java_bytecode_parse(
1811
1813
{
1812
1814
java_bytecode_parsert java_bytecode_parser (skip_instructions);
1813
1815
java_bytecode_parser.in =&istream;
1814
- java_bytecode_parser.set_message_handler (message_handler);
1816
+ java_bytecode_parser.log . set_message_handler (message_handler);
1815
1817
1816
1818
bool parser_result=java_bytecode_parser.parse ();
1817
1819
@@ -1980,9 +1982,15 @@ void java_bytecode_parsert::read_bootstrapmethods_entry()
1980
1982
1981
1983
method_handle_infot method_handle{entry};
1982
1984
1985
+ <<<<<<< HEAD
1983
1986
const u2 num_bootstrap_arguments = read<u2>();
1984
1987
debug () << " INFO: parse BootstrapMethod handle " << num_bootstrap_arguments
1985
1988
<< " #args" << eom;
1989
+ =======
1990
+ u2 num_bootstrap_arguments = read_u2 ();
1991
+ log.debug () << " INFO: parse BootstrapMethod handle "
1992
+ << num_bootstrap_arguments << " #args" << messaget::eom;
1993
+ >>>>>>> parsert is not a messaget
1986
1994
1987
1995
// read u2 values of entry into vector
1988
1996
std::vector<u2> u2_values (num_bootstrap_arguments);
@@ -2021,10 +2029,16 @@ void java_bytecode_parsert::read_bootstrapmethods_entry()
2021
2029
// understand
2022
2030
if (num_bootstrap_arguments < 3 )
2023
2031
{
2032
+ <<<<<<< HEAD
2024
2033
store_unknown_method_handle (bootstrap_method_index);
2025
2034
debug ()
2035
+ =======
2036
+ store_unknown_method_handle (
2037
+ parsed_class, bootstrap_method_index, std::move (u2_values));
2038
+ log.debug ()
2039
+ >>>>>>> parsert is not a messaget
2026
2040
<< " format of BootstrapMethods entry not recognized: too few arguments"
2027
- << eom;
2041
+ << messaget:: eom;
2028
2042
continue ;
2029
2043
}
2030
2044
@@ -2045,10 +2059,18 @@ void java_bytecode_parsert::read_bootstrapmethods_entry()
2045
2059
2046
2060
if (!recognized)
2047
2061
{
2062
+ <<<<<<< HEAD
2048
2063
debug () << " format of BootstrapMethods entry not recognized: extra "
2049
2064
" arguments of wrong type"
2050
2065
<< eom;
2051
2066
store_unknown_method_handle (bootstrap_method_index);
2067
+ =======
2068
+ log.debug () << " format of BootstrapMethods entry not recognized: extra "
2069
+ " arguments of wrong type"
2070
+ << messaget::eom;
2071
+ store_unknown_method_handle (
2072
+ parsed_class, bootstrap_method_index, std::move (u2_values));
2073
+ >>>>>>> parsert is not a messaget
2052
2074
continue ;
2053
2075
}
2054
2076
@@ -2062,30 +2084,48 @@ void java_bytecode_parsert::read_bootstrapmethods_entry()
2062
2084
method_handle_argument.tag != CONSTANT_MethodHandle ||
2063
2085
method_type_argument.tag != CONSTANT_MethodType)
2064
2086
{
2087
+ <<<<<<< HEAD
2065
2088
debug () << " format of BootstrapMethods entry not recognized: arguments "
2066
2089
" wrong type"
2067
2090
<< eom;
2068
2091
store_unknown_method_handle (bootstrap_method_index);
2092
+ =======
2093
+ log.debug ()
2094
+ << " format of BootstrapMethods entry not recognized: arguments "
2095
+ " wrong type"
2096
+ << messaget::eom;
2097
+ store_unknown_method_handle (
2098
+ parsed_class, bootstrap_method_index, std::move (u2_values));
2099
+ >>>>>>> parsert is not a messaget
2069
2100
continue ;
2070
2101
}
2071
2102
2072
- debug () << " INFO: parse lambda handle" << eom;
2103
+ log. debug () << " INFO: parse lambda handle" << messaget:: eom;
2073
2104
optionalt<lambda_method_handlet> lambda_method_handle =
2074
2105
parse_method_handle (method_handle_infot{method_handle_argument});
2075
2106
2076
2107
if (!lambda_method_handle.has_value ())
2077
2108
{
2109
+ <<<<<<< HEAD
2078
2110
debug () << " format of BootstrapMethods entry not recognized: method "
2079
2111
" handle not recognised"
2080
2112
<< eom;
2081
2113
store_unknown_method_handle (bootstrap_method_index);
2114
+ =======
2115
+ log.debug () << " format of BootstrapMethods entry not recognized: method "
2116
+ " handle not recognised"
2117
+ << messaget::eom;
2118
+ store_unknown_method_handle (
2119
+ parsed_class, bootstrap_method_index, std::move (u2_values));
2120
+ >>>>>>> parsert is not a messaget
2082
2121
continue ;
2083
2122
}
2084
2123
2085
2124
// If parse_method_handle can't parse the lambda method, it should return {}
2086
2125
POSTCONDITION (
2087
2126
lambda_method_handle->handle_type != method_handle_typet::UNKNOWN_HANDLE);
2088
2127
2128
+ <<<<<<< HEAD
2089
2129
debug () << " lambda function reference "
2090
2130
<< id2string (lambda_method_handle->get_method_descriptor ()
2091
2131
.base_method_name ())
@@ -2095,6 +2135,21 @@ void java_bytecode_parsert::read_bootstrapmethods_entry()
2095
2135
<< " \n method type is "
2096
2136
<< id2string (pool_entry (method_type_argument.ref1 ).s ) << eom;
2097
2137
parse_tree.parsed_class .add_method_handle (
2138
+ =======
2139
+ lambda_method_handle->interface_type =
2140
+ pool_entry (interface_type_argument.ref1 ).s ;
2141
+ lambda_method_handle->method_type = pool_entry (method_type_argument.ref1 ).s ;
2142
+ lambda_method_handle->u2_values = std::move (u2_values);
2143
+ log.debug () << " lambda function reference "
2144
+ << id2string (lambda_method_handle->lambda_method_name )
2145
+ << " in class \" " << parsed_class.name << " \" "
2146
+ << " \n interface type is "
2147
+ << id2string (pool_entry (interface_type_argument.ref1 ).s )
2148
+ << " \n method type is "
2149
+ << id2string (pool_entry (method_type_argument.ref1 ).s )
2150
+ << messaget::eom;
2151
+ parsed_class.add_method_handle (
2152
+ >>>>>>> parsert is not a messaget
2098
2153
bootstrap_method_index, *lambda_method_handle);
2099
2154
}
2100
2155
}
0 commit comments