From a5fdbdc09a36c83fb53a847cb144e632f68b9a82 Mon Sep 17 00:00:00 2001 From: Chris Smowton Date: Wed, 4 Jan 2017 10:36:50 +0000 Subject: [PATCH] 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. --- src/java_bytecode/java_bytecode_convert_method.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/java_bytecode/java_bytecode_convert_method.cpp b/src/java_bytecode/java_bytecode_convert_method.cpp index a289ee14f58..7e4a1ef1f46 100644 --- a/src/java_bytecode/java_bytecode_convert_method.cpp +++ b/src/java_bytecode/java_bytecode_convert_method.cpp @@ -413,7 +413,9 @@ void java_bytecode_convert_methodt::convert( method_has_this=code_type.has_this(); tmp_vars.clear(); - method_symbol.value=convert_instructions(m.instructions, code_type); + + if((!m.is_abstract) && (!m.is_native)) + method_symbol.value=convert_instructions(m.instructions, code_type); // do we have the method symbol already? const auto s_it=symbol_table.symbols.find(method.get_name());