MCPcopy Index your code
hub / github.com/Palmr/classfile-parser / code_attribute_parser

Function code_attribute_parser

src/attribute_info/parser.rs:46–69  ·  view source on GitHub ↗
(input: &[u8])

Source from the content-addressed store, hash-verified

44}
45
46pub fn code_attribute_parser(input: &[u8]) -> Result<(&[u8], CodeAttribute), Err<&[u8]>> {
47 let (input, max_stack) = be_u16(input)?;
48 let (input, max_locals) = be_u16(input)?;
49 let (input, code_length) = be_u32(input)?;
50 let (input, code) = take(code_length)(input)?;
51 let (input, exception_table_length) = be_u16(input)?;
52 let (input, exception_table) =
53 count(exception_entry_parser, exception_table_length as usize)(input)?;
54 let (input, attributes_count) = be_u16(input)?;
55 let (input, attributes) = count(attribute_parser, attributes_count as usize)(input)?;
56 Ok((
57 input,
58 CodeAttribute {
59 max_stack,
60 max_locals,
61 code_length,
62 code: code.to_owned(),
63 exception_table_length,
64 exception_table,
65 attributes_count,
66 attributes,
67 },
68 ))
69}
70
71pub fn method_parameters_attribute_parser(
72 input: &[u8],

Callers 3

test_valid_classFunction · 0.85
test_classFunction · 0.85

Calls

no outgoing calls

Tested by 3

test_valid_classFunction · 0.68
test_classFunction · 0.68