bugnyacc parser generator - Bugs: bug #62935, bs unsigned-int assignment fails...

 
 

bug #62935: bs unsigned-int assignment fails w/ lognot expressions

Submitter:  Matt Wette <mwette>
Submitted:  Sun 21 Aug 2022 09:20:32 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Confirmed
Privacy:  Public Assigned to:  mwette
Open/Closed:  Open
* Mandatory Fields

Add a New Comment Rich Markup
   

Sun 21 Aug 2022 09:20:32 PM UTC, original submission:  

(lognot val) can be negative.  If passed to bytestructure-set where unsigned is assumed, it's rejected.

Workaround:
(define (bs:int->uint val desc)
  (if (negative? val)
      (case (bytestructure-descriptor-size desc)
        ((1) (+ val #x100))
        ((2) (+ val #x10000))
        ((4) (+ val #x100000000))
        ((8) (+ val #x10000000000000000))
        (else (throw 'ffi-error)))
      val))

Matt Wette <mwette>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by mwette (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    No changes have been made to this item

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code