Skip to content

Commit

Permalink
remove_message does not store any pointer to x0
Browse files Browse the repository at this point in the history
On OTP 20 erlang compiler generates following code:
```
{get_tuple_element,{x,0},1,{x,0}}.
remove_message.
```

x0 is clearly still used and it shouldn't be overwritten by
remove_message, also in msg_instrs.tab only loop_rec has
`r(0) = ERL_MESSAGE_TERM(msgp);`.
  • Loading branch information
bettio authored and happi committed Aug 26, 2018
1 parent 99cb177 commit 122b558
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions chapters/beam_instructions.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -346,8 +346,8 @@ handling.

For code like +receive _ -> ok end+, where we accept any messages,
there is no pattern matching needed, we just do a +remove_message+
which unlinks the next message from the message queue and stores a
pointer in X0. (It also removes any timeout, more on this soon.)
which unlinks the next message from the message queue. (It also
removes any timeout, more on this soon.)

==== A Selective Receive Loop

Expand Down

0 comments on commit 122b558

Please sign in to comment.