MCPcopy Create free account
hub / github.com/cretz/stackparam / add_native_stack_params_method

Function add_native_stack_params_method

src/manip.rs:146–156  ·  view source on GitHub ↗
(class_file: &mut Classfile)

Source from the content-addressed store, hash-verified

144}
145
146unsafe fn add_native_stack_params_method(class_file: &mut Classfile) {
147 // Create native stackParamFillInStackTrace(Thread)
148 let sp_fill_meth_name_idx = utf8_const(class_file, "stackParamFillInStackTrace");
149 let meth_thread_ret_throwable_idx = utf8_const(class_file, "(Ljava/lang/Thread;)Ljava/lang/Throwable;");
150 class_file.methods.push(Method {
151 access_flags: AccessFlags { flags: MethodAccessFlags::Private as u16 + MethodAccessFlags::Native as u16 },
152 name_index: ConstantPoolIndex { idx: sp_fill_meth_name_idx },
153 descriptor_index: ConstantPoolIndex { idx: meth_thread_ret_throwable_idx },
154 attributes: Vec::new()
155 });
156}
157
158unsafe fn update_fill_method(class_file: &mut Classfile) -> Result<(), String> {
159 // Change existing fillInStackTrace to call stackParamFillInStackTrace(Thread) right after fillInStackTrace(0)

Callers 1

manip_throwable_classFunction · 0.85

Calls 1

utf8_constFunction · 0.85

Tested by

no test coverage detected