Skip to content

Commit 2c6c8a9

Browse files
block name fix in readtl2
1 parent 912c7de commit 2c6c8a9

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

internal/tlcodegen/type_rw_struct_php.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1042,7 +1042,7 @@ func (trw *TypeRWStruct) phpStructReadTL2Code(targetName string, usedBytesPointe
10421042
if isTrue {
10431043
cc.AddLines(fmt.Sprintf("%[1]s = false;", fieldName))
10441044
}
1045-
cc.If(fmt.Sprintf("($block & (1 << %d)) != 0", inBlockIndex), func(cc *codecreator.PhpCodeCreator) {
1045+
cc.If(fmt.Sprintf("(%[1]s & (1 << %[2]d)) != 0", block, inBlockIndex), func(cc *codecreator.PhpCodeCreator) {
10461046
tree := trw.PHPGetFieldNatDependenciesValuesAsTypeTree(fieldIndex, calculatedArgs)
10471047
localUsedBytes := fmt.Sprintf("$local_used_bytes_%s_%d", supportSuffix, callLevel)
10481048
cc.Comments("local size for this field")

internal/tlcodegen/type_rw_union_php.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ func (trw *TypeRWUnion) PhpReadTL2MethodCall(targetName string, bare bool, initI
299299
fmt.Sprintf("if (%[1]s != 0) {", localCurrentSize),
300300
fmt.Sprintf(" %[1]s = fetch_byte();", localBlock),
301301
fmt.Sprintf(" %[1]s += 1;", localUsedBytesPointer),
302-
fmt.Sprintf(" if (%[1]s & 1 != 0) {", localBlock),
302+
fmt.Sprintf(" if ((%[1]s & 1) != 0) {", localBlock),
303303
fmt.Sprintf(" %[1]s = TL\\tl2_support::fetch_size();", localConstructor),
304304
fmt.Sprintf(" %[1]s += TL\\tl2_support::count_used_bytes(%[2]s);", localUsedBytesPointer, localConstructor),
305305
" }",

0 commit comments

Comments
 (0)