Skip to content

Commit a5fdbdc

Browse files
committed
Don't assign abstract or native methods an empty body
This commit leaves them with a nil value, to differentiate them from a method that actually has an empty body (i.e. `{}`) It has no immediate impact, but will make forthcoming changes easier as we can assume that every non-nil method has at least one instruction.
1 parent 05652d2 commit a5fdbdc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/java_bytecode/java_bytecode_convert_method.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,9 @@ void java_bytecode_convert_methodt::convert(
413413
method_has_this=code_type.has_this();
414414

415415
tmp_vars.clear();
416-
method_symbol.value=convert_instructions(m.instructions, code_type);
416+
417+
if((!m.is_abstract) && (!m.is_native))
418+
method_symbol.value=convert_instructions(m.instructions, code_type);
417419

418420
// do we have the method symbol already?
419421
const auto s_it=symbol_table.symbols.find(method.get_name());

0 commit comments

Comments
 (0)