@@ -670,7 +670,7 @@ library LibClone {
670670 assembly {
671671 args := mload (0x40 )
672672 let n := and (0xffffffffff , sub (extcodesize (instance), 0x2d ))
673- let l := sub (n, mul (start, lt (start, n)))
673+ let l := sub (n, mul (and ( lt ( start, 0xffff ), lt (start, n)), start ))
674674 extcodecopy (instance, add (args, 0x20 ), add (start, 0x2d ), add (l, 0x20 ))
675675 mstore (args, mul (sub (n, start), lt (start, n))) // Store the length.
676676 mstore (0x40 , add (args, add (0x40 , mload (args)))) // Allocate memory.
@@ -1145,7 +1145,7 @@ library LibClone {
11451145 assembly {
11461146 args := mload (0x40 )
11471147 let n := and (0xffffffffff , sub (extcodesize (instance), 0x3d ))
1148- let l := sub (n, mul (start, lt (start, n)))
1148+ let l := sub (n, mul (and ( lt ( start, 0xffff ), lt (start, n)), start ))
11491149 extcodecopy (instance, add (args, 0x20 ), add (start, 0x3d ), add (l, 0x20 ))
11501150 mstore (args, mul (sub (n, start), lt (start, n))) // Store the length.
11511151 mstore (0x40 , add (args, add (0x40 , mload (args)))) // Allocate memory.
@@ -1646,7 +1646,7 @@ library LibClone {
16461646 assembly {
16471647 args := mload (0x40 )
16481648 let n := and (0xffffffffff , sub (extcodesize (instance), 0x52 ))
1649- let l := sub (n, mul (start, lt (start, n)))
1649+ let l := sub (n, mul (and ( lt ( start, 0xffff ), lt (start, n)), start ))
16501650 extcodecopy (instance, add (args, 0x20 ), add (start, 0x52 ), add (l, 0x20 ))
16511651 mstore (args, mul (sub (n, start), lt (start, n))) // Store the length.
16521652 mstore (0x40 , add (mload (args), add (args, 0x40 ))) // Allocate memory.
@@ -2242,7 +2242,7 @@ library LibClone {
22422242 assembly {
22432243 args := mload (0x40 )
22442244 let n := and (0xffffffffff , sub (extcodesize (instance), 0x52 ))
2245- let l := sub (n, mul (start, lt (start, n)))
2245+ let l := sub (n, mul (and ( lt ( start, 0xffff ), lt (start, n)), start ))
22462246 extcodecopy (instance, add (args, 0x20 ), add (start, 0x52 ), add (l, 0x20 ))
22472247 mstore (args, mul (sub (n, start), lt (start, n))) // Store the length.
22482248 mstore (0x40 , add (args, add (0x40 , mload (args)))) // Allocate memory.
@@ -2745,7 +2745,7 @@ library LibClone {
27452745 assembly {
27462746 args := mload (0x40 )
27472747 let n := and (0xffffffffff , sub (extcodesize (instance), 0x57 ))
2748- let l := sub (n, mul (start, lt (start, n)))
2748+ let l := sub (n, mul (and ( lt ( start, 0xffff ), lt (start, n)), start ))
27492749 extcodecopy (instance, add (args, 0x20 ), add (start, 0x57 ), add (l, 0x20 ))
27502750 mstore (args, mul (sub (n, start), lt (start, n))) // Store the length.
27512751 mstore (0x40 , add (args, add (0x40 , mload (args)))) // Allocate memory.
0 commit comments