Subject: [rohc] Use of the stack

From: "Surtees, Abigail" <[email-masked]>
Date: Mon, 13 Jun 2005 16:05:59 +0100

Hi All,

There is potential for confusion in the definition of use of the VM
stack.  The likelihood of this case ever happening is very very slim,
however, I think it is ambiguous.

RFC 3320 says:
", the notation
   stack[n] is an abbreviation for the 2-byte word at
   stack_location+2*n+2 and stack_location+2*n+3.  (As always, the
   arithmetic is modulo 2^16.)"
and 
""Pushing" a value on the stack is an abbreviation for copying the
   value to stack[stack_fill] and then increasing stack_fill by 1."

What happens if the value in stack_fill is 0xFFFF?

Stack[0xFFFF] 
= stack_location + 2 * 0xFFFF + 2 
= stack_location + 1FFFE + 2 
= stack_location + 0 
= stack_location.

Then increase stack_fill by 1, but stack_fill is the 2 byte word at
stack_location and stack_location + 1 which has just been updated.

Should the value of stack_fill be re-read, or should the original value
(0xFFFF) be incremented by 1?

I implemented it without re-reading stack_fill and this seems to me to
make the most sense (avoiding the need for this as a special case),
however, I'd like to know what other people think.  I think this should
be added to the implementer's guide, once we've decided which the
intended/correct answer is.

Best regards,

Abbie

Abbie Surtees
Senior Engineer
Roke Manor Research Ltd
Old Salisbury Lane
Romsey, SO51 0ZN
Tel:   +44 (0) 1794 833131

_______________________________________________
Rohc mailing list
[email-masked]
https://www1.ietf.org/mailman/listinfo/rohc

---

From: Pekka Pessi <[email-masked]>
Date: Thu, 23 Jun 2005 18:44:41 +0300

"Surtees, Abigail" <[email-masked]> writes:
...

>(0xFFFF) be incremented by 1?

I'd vote for incrementing original value and storing it in
stack_fill (otherwise UDVM wll lose the stack underflow error,
which is stack overflow in this case).

--Pekka