[cfe-dev] assertion triggered: "Illegal argument to getIntegerConstantExpr"

Roman Divacky rdivacky at freebsd.org
Wed Oct 15 08:30:50 PDT 2008


On Wed, Oct 15, 2008 at 08:15:25AM -0700, Chris Lattner wrote:
> 
> On Oct 15, 2008, at 5:26 AM, Roman Divacky wrote:
> 
> >hi
> >
> >uloziste /tmp$ cat cat.c
> >#include <sys/un.h>
> >
> >#include <stddef.h>
> >
> >void
> >main()
> >{
> >  	int len = offsetof(struct sockaddr_un, sun_path[len+1]);
> >}
> >uloziste /tmp$ ccc cat.c
> >Assertion failed: (success && "Illegal argument to  
> >getIntegerConstantExpr"), function getIntegerConstantExprValue,
> >file /usr/ports/devel/llvm-devel/work/llvm-2.4.snap20081014/tools/ 
> >clang/lib/AST/../../include/clang/AST/Expr.h,
> >line 105.
> >uloziste /tmp$
> >
> >with llvm/clang-2.4 from 20081014 date. This is a stripped down test- 
> >case of a larger
> >program so dont wonder why it looks like it does :)
> 
> Hi Roman,
> 
> I can't debug this without the contents of sys/un.h.  Can you please  
> generate a .i file with "clang -E cat.c -o cat.i" and attach that?   
> Thanks,

here it is:
-------------- next part --------------
# 1 "cat.c"
# 1 "cat.c" 1
# 0 "cat.c"
# 1 "<predefines>" 1
# 1 "cat.c" 2
# 1 "/usr/include/sys/un.h" 1 3 4
# 36 "/usr/include/sys/un.h" 3 4
# 1 "/usr/include/sys/cdefs.h" 1 3 4
# 37 "/usr/include/sys/un.h" 2 3 4
# 1 "/usr/include/sys/_types.h" 1 3 4
# 33 "/usr/include/sys/_types.h" 3 4
# 1 "/usr/include/machine/_types.h" 1 3 4
# 51 "/usr/include/machine/_types.h" 3 4
typedef signed char __int8_t;
typedef unsigned char __uint8_t;
typedef short __int16_t;
typedef unsigned short __uint16_t;
typedef int __int32_t;
typedef unsigned int __uint32_t;
typedef long __int64_t;
typedef unsigned long __uint64_t;




typedef __int32_t __clock_t;
typedef unsigned int __cpumask_t;
typedef __int64_t __critical_t;
typedef double __double_t;
typedef double __float_t;
typedef __int64_t __intfptr_t;
typedef __int64_t __intmax_t;
typedef __int64_t __intptr_t;
typedef __int32_t __int_fast8_t;
typedef __int32_t __int_fast16_t;
typedef __int32_t __int_fast32_t;
typedef __int64_t __int_fast64_t;
typedef __int8_t __int_least8_t;
typedef __int16_t __int_least16_t;
typedef __int32_t __int_least32_t;
typedef __int64_t __int_least64_t;
typedef __int64_t __ptrdiff_t;
typedef __int64_t __register_t;
typedef __int64_t __segsz_t;
typedef __uint64_t __size_t;
typedef __int64_t __ssize_t;
typedef __int64_t __time_t;
typedef __uint64_t __uintfptr_t;
typedef __uint64_t __uintmax_t;
typedef __uint64_t __uintptr_t;
typedef __uint32_t __uint_fast8_t;
typedef __uint32_t __uint_fast16_t;
typedef __uint32_t __uint_fast32_t;
typedef __uint64_t __uint_fast64_t;
typedef __uint8_t __uint_least8_t;
typedef __uint16_t __uint_least16_t;
typedef __uint32_t __uint_least32_t;
typedef __uint64_t __uint_least64_t;
typedef __uint64_t __u_register_t;
typedef __uint64_t __vm_offset_t;
typedef __int64_t __vm_ooffset_t;
typedef __uint64_t __vm_paddr_t;
typedef __uint64_t __vm_pindex_t;
typedef __uint64_t __vm_size_t;





typedef __builtin_va_list __va_list;






typedef __va_list __gnuc_va_list;
# 34 "/usr/include/sys/_types.h" 2 3 4




typedef __uint32_t __blksize_t;
typedef __int64_t __blkcnt_t;
typedef __int32_t __clockid_t;
typedef __uint32_t __fflags_t;
typedef __uint64_t __fsblkcnt_t;
typedef __uint64_t __fsfilcnt_t;
typedef __uint32_t __gid_t;
typedef __int64_t __id_t;
typedef __uint32_t __ino_t;
typedef long __key_t;
typedef __int32_t __lwpid_t;
typedef __uint16_t __mode_t;
typedef int __nl_item;
typedef __uint16_t __nlink_t;
typedef __int64_t __off_t;
typedef __int32_t __pid_t;
typedef __int64_t __rlim_t;


typedef __uint8_t __sa_family_t;
typedef __uint32_t __socklen_t;
typedef long __suseconds_t;
typedef struct __timer *__timer_t;
typedef struct __mq *__mqd_t;
typedef __uint32_t __uid_t;
typedef unsigned int __useconds_t;
# 83 "/usr/include/sys/_types.h" 3 4
typedef int __ct_rune_t;
typedef __ct_rune_t __rune_t;
typedef __ct_rune_t __wchar_t;
typedef __ct_rune_t __wint_t;

typedef __uint32_t __dev_t;

typedef __uint32_t __fixpt_t;





typedef union {
 char __mbstate8[128];
 __int64_t _mbstateL;
} __mbstate_t;
# 38 "/usr/include/sys/un.h" 2 3 4


typedef __sa_family_t sa_family_t;






struct sockaddr_un {
 unsigned char sun_len;
 sa_family_t sun_family;
 char sun_path[104];
};
# 2 "cat.c" 2

# 1 "/usr/include/stddef.h" 1 3 4
# 42 "/usr/include/stddef.h" 3 4
# 1 "/usr/include/sys/_null.h" 1 3 4
# 43 "/usr/include/stddef.h" 2 3 4


typedef __ptrdiff_t ptrdiff_t;



typedef __rune_t rune_t;





typedef __size_t size_t;





typedef __wchar_t wchar_t;
# 4 "cat.c" 2

void
main()
{
 int len = __builtin_offsetof(struct sockaddr_un, sun_path[len+1]);
}


More information about the cfe-dev mailing list