bugGNU nano - Bugs: bug #48540, left shift of 1 by 31 places...

 
 

bug #48540: left shift of 1 by 31 places cannot be represented in type 'int'

Submitted by:  None
Submitted on:  Sun 17 Jul 2016 10:59:59 AM UTC  
 
Severity: 2 - MinorStatus: Fixed
Assigned to: Benno Schulenberg <bens>Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Fri 22 Jul 2016 02:05:14 PM UTC, comment #2:

Fixed in git, 04b9b9c.

Thanks for reporting. If you find any more of this stuff, don't hesitate.

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Sun 17 Jul 2016 06:34:16 PM UTC, comment #1:

Strange. The flags array is unsigned int. Why would using the highest bit of an unsigned int be undefined?

Attached patch avoids the issue. If an integer is just two bytes, the array has then room for 56 flags. We now have 39, so that still easily fits.

(file #37925)

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Sun 17 Jul 2016 10:59:59 AM UTC, original submission:

When compiled with the undefined behaviour sanitizer active, i.e.
I'm getting an error in nano.c
which is this if-statement:
BOLD_TEXT is index 31 in nano.h
No idea what's the best fix thou

Anonymous

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #37925:  just-use-28-bits.patch added by bens (659B - text/x-diff)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by bens (Updated the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 30 Jul 2016 09:25:09 AM UTCbensSeverity3 - Normal=>2 - Minor
      Open/ClosedOpen=>Closed
    Fri 22 Jul 2016 02:05:14 PM UTCbensStatusConfirmed=>Fixed
      Assigned toNone=>bens
    Sun 17 Jul 2016 06:34:16 PM UTCbensAttached File-=>Added just-use-28-bits.patch, #37925
      StatusNone=>Confirmed

    Back to the top


    Powered by Savane 3.1-cleanup1