File tree Expand file tree Collapse file tree 3 files changed +7
-27
lines changed
Expand file tree Collapse file tree 3 files changed +7
-27
lines changed Original file line number Diff line number Diff line change @@ -192,8 +192,9 @@ public function getValue(): string
192192 ->getResult (false )
193193 ->getEntryIndex ()
194194 );
195- $ writer ->writeUnsignedInt (strlen ($ attribute ->getValue ()));
196- $ writer ->write ($ attribute ->getValue ());
195+ $ value = $ attribute ->getValue ();
196+ $ writer ->writeUnsignedInt (strlen ($ value ));
197+ $ writer ->write ($ value );
197198 }
198199
199200 return $ writer ->getStreamContents ();
Original file line number Diff line number Diff line change @@ -126,19 +126,6 @@ public function getValue(): string
126126 $ emulatedAccumulator = new Accumulator ();
127127 $ currentOffset = 0 ;
128128
129- // foreach ($this->localVariables as $variableName => $variable) {
130- // [$index, $classType] = $variable;
131- // $emulatedAccumulator
132- // ->setDefaultLocal(
133- // $index,
134- // [
135- // VerificationTypeTag::ITEM_Object,
136- // $this->getEnhancedConstantPool()
137- // ->findClass($classType),
138- // ]
139- // );
140- // }
141-
142129 foreach ($ this ->operations as $ operation ) {
143130 $ programCounter = $ this ->calculateProgramCounterByOperationCodes (
144131 $ this ->operations ,
Original file line number Diff line number Diff line change @@ -14,21 +14,13 @@ public function build(): void
1414 // Write attribute_name_index
1515 $ this ->binaryWriter ->writeUnsignedShort ($ attribute ->getConstantPoolIndex ());
1616
17+ $ value = $ attribute ->getValue ();
18+
1719 // Write attribute_length
18- $ this ->binaryWriter ->writeUnsignedInt (strlen ($ attribute -> getValue () ));
20+ $ this ->binaryWriter ->writeUnsignedInt (strlen ($ value ));
1921
2022 // Write attribute
21- $ this ->binaryWriter ->write ($ attribute ->getValue ());
22-
23- if (!$ attribute ->hasAttribute ()) {
24- continue ;
25- }
26-
27- // Write attributes_count
28- AttributesCount::init ($ attribute ->getAttributes (), $ this ->constantPool , $ this ->binaryWriter );
29-
30- // Write attributes
31- Attributes::init ($ attribute ->getAttributes (), $ this ->constantPool , $ this ->binaryWriter );
23+ $ this ->binaryWriter ->write ($ value );
3224 }
3325 }
3426}
You can’t perform that action at this time.
0 commit comments