[
https://issues.apache.org/jira/browse/DAFFODIL-2703?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17552798#comment-17552798
]
Steve Lawrence commented on DAFFODIL-2703:
------------------------------------------
Actually, this is maybe partly an issue with using the %#xNN; format? If I use
that, %#x00 gives the expected results, but %#FF; gives the exact same results
as %#F0; for both runtimes. I'm not sure what's going on there.
If i use the %#rXX; syntax, everything works correctly with runtime1, including
00, FF, and F0.
With runtime2, 00 works as expected, but FF and F0 do not:
* fillByte of FF, infoset value of 1 unparses to 0x9b (1001 1111), infoset
value of 0 unparses to 0x1b (0001 1011)
* fillByte of F0, infoset value of 1 unparses to 0x98 (1001 1000), infoset
value of 0 unparses to 0x18 (0001 1000)
So runtime2 seems to have a bug with non-0x00 fill bytes. And maybe there's a
bug wih the %#XX; syntax in general?
> Unaligned RightFill does not unparse correctly
> ----------------------------------------------
>
> Key: DAFFODIL-2703
> URL: https://issues.apache.org/jira/browse/DAFFODIL-2703
> Project: Daffodil
> Issue Type: Bug
> Components: Back End, Back End C-Generator
> Affects Versions: 3.3.0
> Reporter: Steve Lawrence
> Priority: Major
> Attachments: unalignedRightFill.tdml
>
>
> See the attached unalignedRightFill.tdml file for reproducible tests.
> Data is a single byte. Only the most significant bit is actual data. The
> remaining 7 bits are RightFill region using a fillByte value of 0xF0. So the
> data should always unparse to X111 0000, where the value of X comes from the
> infoset.
> Note that runtime1 and runtime2 have different behaviors, neither of which I
> think is correct:
>
>
> *unalignedRightFill_01* (bit from infoset is 1)
> should unparse to 0xF0 (1111 0000)
> runtime1 unparses to 0xBF (1011 1111)
> runtime2 unparses to 0x9F (1001 1111)
>
> *unalignedRightFill_02* (bit from infoset is 0)
> should unparse to 0x70 (0111 0000)
> runtime1 unaprses to 0x3F (0011 1111)
> runtime2 unparses to 0x1F (0001 1111)
--
This message was sent by Atlassian Jira
(v8.20.7#820007)