Skip to content

Not giving the right value to a variable in the book #25635

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
tim-br opened this issue May 20, 2015 · 3 comments · Fixed by #25761
Closed

Not giving the right value to a variable in the book #25635

tim-br opened this issue May 20, 2015 · 3 comments · Fixed by #25761

Comments

@tim-br
Copy link

tim-br commented May 20, 2015

At the end of bar(), it calls baz():

In the code baz is passed f whose value is the address of d which is 9.

However, in the diagram, it is given a value of 4.

Address Name    Value
230     20
(230) - 1       5
... ... ...
12  g   100
11  f   4
10  e   9
9   d   (230) - 1
8   c   5
7   b   4
6   a   0
5   z   4
4   y   10
3   x   0
2   j   0
1   i   230
0   h   3
@steveklabnik
Copy link
Member

I believe this is fixed on master, can you confirm?

@tim-br
Copy link
Author

tim-br commented May 22, 2015

I believe it should say
11 f 9

not

11 f 4

@ralexstokes
Copy link
Contributor

@steveklabnik not fixed on master but just filed a PR to do so

bors added a commit that referenced this issue May 25, 2015
Typo in explanation of difference between stack and heap values.  

`baz` is called at the end of a call to `bar` inside another call to `foo`.  `baz` takes a copy of the value `e` which should have a value of 9 if following the rest of the stack trace.

This PR fixes this typo and should close #25635.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants