RE: [sarif] #401: Improved design of address object design

From
Laurence Golding
Date
2019-04-29T20:21:00+00:00
ID
Thread
RE: [sarif] #401: Improved design of address object design
There s a problem with
  relativeAddress  , though. Here s what I currently have:

3.32.4 Relative address calculation

Each

address
object has an associated value called its  relative address  which is
  the offset of the address from the address of the top-most object in its parent chain

3.32.7 relativeAddress property

  If

parentIndex
(
3.32.13  )
  is present, an
address
object
  MAY  contain a property named
relativeAddress
whose value is an integer containing the
  relative address (see
3.32.4  ) of

thisObject  .

  If

parentIndex
is absent, then

relativeAddress
  SHALL  be absent.

  If

relativeAddress
is absent, it
  SHALL  default to  -1, which is otherwise not a valid value for this property .



That s wrong. If your top-most address is a downward-growing stack,

relativeAddress
can be negative. And unlike

offsetFromParent  , we can t say (I mean, we
  can , but don t think we should) that
relativeAddress
  SHALL  be present if
parentIndex
is present, so we can t use 0 as the default.



Ideas?



I m going to have lunch now. Back in a while.



Larry
From:
 <>
  On Behalf Of  Larry Golding (Myriad Consulting Inc)

Sent:  Monday, April 29, 2019 12:59 PM
To:  Michael Fanning <>; James Kupsch <>; OASIS SARIF TC Discussion List <>
Subject:  RE: [sarif] #401: Improved design of address object design



I approve this message! Much better than my solution.
From:
Michael Fanning < 
>

  Sent:  Monday, April 29, 2019 12:56 PM
To:  James Kupsch <  >; Larry Golding (Myriad Consulting Inc) <  >; OASIS SARIF TC Discussion List < 
>
Subject:  RE: [sarif] #401: Improved design of address object design



Here s my suggestion:



For address.length, use a sentinel value of  0  meaning  not provided . This makes sense, as Jim noted, a 0 length memory address isn t sensible. You don t posit describing an insertion point in memory that
  shoves everything to the right.