Project

General

Profile

Actions

Bug #7673

closed

Wrong transformation with type conversion

Added by Anton Vasilyev over 7 years ago. Updated almost 4 years ago.

Status:
Closed
Priority:
Normal
Category:
C back-end
Start date:
11/02/2016
Due date:
% Done:

0%

Estimated time:
Detected in build:
svn
Platform:
Linux x64
Published in build:

Description

CIF transforms

u8 *dst; *(u16 *)(dst + 4) 
to
*((u16 *)dst + 4U) 
with different meaning: first has offset 32 from dst, second has offset 64 from dst.
Source code is attached.

It seem that the same problem occurs with:

#define container_of(ptr, type, member) ({                      \
        const typeof( ((type *)0)->member ) *__mptr = (ptr);    \
        (type *)( (char *)__mptr - offsetof(type,member) );})
#define to_usb_device(d) container_of(d, struct usb_device, dev)
static inline struct usb_device *interface_to_usbdev(struct usb_interface *intf)
{
  return to_usb_device(intf->dev.parent);
}

CIF omits conversion (char *)__mptr

__inline static struct usb_device *interface_to_usbdev(struct usb_interface *intf ) 
{ 
  struct device  const  *__mptr ;

  {
    __mptr = (struct device  const  *)intf->dev.parent;
    return ((struct usb_device *)__mptr + 0xffffffffffffff70UL);
  }
}


Files

ether_addr_copy (225 Bytes) ether_addr_copy Anton Vasilyev, 11/02/2016 04:58 PM

Related issues 1 (0 open1 closed)

Related to C Instrumentation Framework - Bug #7833: Wrong array address transformationRejected01/09/2017

Actions
Actions

Also available in: Atom PDF