@@ -1037,6 +1037,7 @@ bool java_bytecode_languaget::convert_single_method(
10371037 // Nothing to do if body is already loaded
10381038 if (symbol.value .is_not_nil ())
10391039 return false ;
1040+ INVARIANT (declaring_class (symbol), " Method must have a declaring class." );
10401041
10411042 // Get bytecode for specified function if we have it
10421043 method_bytecodet::opt_reft cmb = method_bytecode.get (function_id);
@@ -1060,6 +1061,8 @@ bool java_bytecode_languaget::convert_single_method(
10601061 // Add these to the needed_lazy_methods collection
10611062 notify_static_method_calls (generated_code, needed_lazy_methods);
10621063 writable_symbol.value = std::move (generated_code);
1064+ INVARIANT (
1065+ declaring_class (writable_symbol), " Method must have a declaring class." );
10631066 return false ;
10641067 }
10651068 else if (
@@ -1103,6 +1106,8 @@ bool java_bytecode_languaget::convert_single_method(
11031106 // function:
11041107 notify_static_method_calls (
11051108 to_code (writable_symbol.value ), needed_lazy_methods);
1109+ INVARIANT (
1110+ declaring_class (writable_symbol), " Method must have a declaring class." );
11061111 return false ;
11071112 }
11081113
@@ -1121,6 +1126,7 @@ bool java_bytecode_languaget::convert_single_method(
11211126 string_preprocess,
11221127 class_hierarchy,
11231128 threading_support);
1129+ INVARIANT (declaring_class (symbol), " Method must have a declaring class." );
11241130 return false ;
11251131 }
11261132
@@ -1144,6 +1150,7 @@ bool java_bytecode_languaget::convert_single_method(
11441150 needed_lazy_methods->add_all_needed_classes (*pointer_return_type);
11451151 }
11461152
1153+ INVARIANT (declaring_class (symbol), " Method must have a declaring class." );
11471154 return true ;
11481155}
11491156
0 commit comments