You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After so many years, seems go compiler optimization have changed a lot. One problem is in chapter 2, iface.go, chapter 2. To make the assembly code call the function through itab func pointer,
func main() {
m := Mather(Adder{id: 6754})
// This call just makes sure that the interface is actually used.
// Without this call, the linker would see that the interface defined above
// is in fact never used, and thus would optimize it out of the final
// executable.
m.Add(10, 32)
}
should be changed to
func main() {
var m Mather
m = Adder{id: 6754}
// This call just makes sure that the interface is actually used.
// Without this call, the linker would see that the interface defined above
// is in fact never used, and thus would optimize it out of the final
// executable.
m.Add(10, 32)
}
Or the assembly code would CALL "".Adder.Add(SB) directly.
The text was updated successfully, but these errors were encountered:
After so many years, seems go compiler optimization have changed a lot. One problem is in chapter 2, iface.go, chapter 2. To make the assembly code call the function through itab func pointer,
should be changed to
Or the assembly code would CALL "".Adder.Add(SB) directly.
The text was updated successfully, but these errors were encountered: