Quantcast

invalid bits size for WrittenBuiltinSpecs::Type

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

invalid bits size for WrittenBuiltinSpecs::Type

Keane, Erich via cfe-dev
Hello Clang Developers,

in file clang/Basic/Specifiers.h there is
    struct clang::WrittenBuiltinSpecs {
      /*DeclSpec::TST*/ unsigned Type  : 5; // << must be *6*
....
   };

"Type" field must be 6 to match DeclSpec::TST which is the same as enum
TypeSpecifierType
which has
  TST_error // erroneous type
with value 43 which can not be kept in 5 bits field.

as a correct example you can see that
clang::DeclSpec::TypeSpecType field is 6 bits

So, we corrupt values  during save in
clang::DeclSpec::SaveWrittenBuiltinSpecs for all after TST_image1d_t.
Btw, due to this TST_error is changed to TST_float128....

Hope it helps,
Vladimir.
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: invalid bits size for WrittenBuiltinSpecs::Type

Keane, Erich via cfe-dev
Thanks, fixed in r297654.

On Mon, Mar 13, 2017 at 10:35 AM, Vladimir Voskresensky via cfe-dev <[hidden email]> wrote:
Hello Clang Developers,

in file clang/Basic/Specifiers.h there is
   struct clang::WrittenBuiltinSpecs {
     /*DeclSpec::TST*/ unsigned Type  : 5; // << must be *6*
....
  };

"Type" field must be 6 to match DeclSpec::TST which is the same as enum TypeSpecifierType
which has
 TST_error // erroneous type
with value 43 which can not be kept in 5 bits field.

as a correct example you can see that
clang::DeclSpec::TypeSpecType field is 6 bits

So, we corrupt values  during save in clang::DeclSpec::SaveWrittenBuiltinSpecs for all after TST_image1d_t.
Btw, due to this TST_error is changed to TST_float128....

Hope it helps,
Vladimir.
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: invalid bits size for WrittenBuiltinSpecs::Type

Keane, Erich via cfe-dev
Reid,

May be it's worth to have the same assert for clang::DeclSpec::TypeSpecType?

Thanks,
Vladimir.

On 13.03.2017 21:59, Reid Kleckner via cfe-dev wrote:
Thanks, fixed in r297654.

On Mon, Mar 13, 2017 at 10:35 AM, Vladimir Voskresensky via cfe-dev <[hidden email]> wrote:
Hello Clang Developers,

in file clang/Basic/Specifiers.h there is
   struct clang::WrittenBuiltinSpecs {
     /*DeclSpec::TST*/ unsigned Type  : 5; // << must be *6*
....
  };

"Type" field must be 6 to match DeclSpec::TST which is the same as enum TypeSpecifierType
which has
 TST_error // erroneous type
with value 43 which can not be kept in 5 bits field.

as a correct example you can see that
clang::DeclSpec::TypeSpecType field is 6 bits

So, we corrupt values  during save in clang::DeclSpec::SaveWrittenBuiltinSpecs for all after TST_image1d_t.
Btw, due to this TST_error is changed to TST_float128....

Hope it helps,
Vladimir.
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev



_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: invalid bits size for WrittenBuiltinSpecs::Type

Keane, Erich via cfe-dev
I think this is something the compiler should catch. I'm writing a generalized warning in clang for it right now.

On Mon, Mar 13, 2017 at 12:57 PM, Vladimir Voskresensky via cfe-dev <[hidden email]> wrote:
Reid,

May be it's worth to have the same assert for clang::DeclSpec::TypeSpecType?

Thanks,
Vladimir.


On 13.03.2017 21:59, Reid Kleckner via cfe-dev wrote:
Thanks, fixed in r297654.

On Mon, Mar 13, 2017 at 10:35 AM, Vladimir Voskresensky via cfe-dev <[hidden email][hidden email]> wrote:
Hello Clang Developers,

in file clang/Basic/Specifiers.h there is
   struct clang::WrittenBuiltinSpecs {
     /*DeclSpec::TST*/ unsigned Type  : 5; // << must be *6*
....
  };

"Type" field must be 6 to match DeclSpec::TST which is the same as enum TypeSpecifierType
which has
 TST_error // erroneous type
with value 43 which can not be kept in 5 bits field.

as a correct example you can see that
clang::DeclSpec::TypeSpecType field is 6 bits

So, we corrupt values  during save in clang::DeclSpec::SaveWrittenBuiltinSpecs for all after TST_image1d_t.
Btw, due to this TST_error is changed to TST_float128....

Hope it helps,
Vladimir.
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev



_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev



_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: invalid bits size for WrittenBuiltinSpecs::Type

Keane, Erich via cfe-dev


On 14.03.2017 00:33, Reid Kleckner via cfe-dev wrote:
I think this is something the compiler should catch. I'm writing a generalized warning in clang for it right now.
Yes, I agree. In fact, this is how I got here myself. I ran test
${LLVM_SRC}/llvm/tools/clang/test/Lexer/cxx1z-trigraphs.cpp
using Clank (the Java port of CLang)
https://eurollvm2017.sched.com/event/9wDw/clank-java-port-of-cc-compiler-frontend
 and got Java-assert that reducing from enumerator to 5 bits doesn't fit for TST_error value :-)

Please, send me the changeset when you are done with compiler warning.

Thanks!
Vladimir.


On Mon, Mar 13, 2017 at 12:57 PM, Vladimir Voskresensky via cfe-dev <[hidden email]> wrote:
Reid,

May be it's worth to have the same assert for clang::DeclSpec::TypeSpecType?

Thanks,
Vladimir.


On 13.03.2017 21:59, Reid Kleckner via cfe-dev wrote:
Thanks, fixed in r297654.

On Mon, Mar 13, 2017 at 10:35 AM, Vladimir Voskresensky via cfe-dev <[hidden email]> wrote:
Hello Clang Developers,

in file clang/Basic/Specifiers.h there is
   struct clang::WrittenBuiltinSpecs {
     /*DeclSpec::TST*/ unsigned Type  : 5; // << must be *6*
....
  };

"Type" field must be 6 to match DeclSpec::TST which is the same as enum TypeSpecifierType
which has
 TST_error // erroneous type
with value 43 which can not be kept in 5 bits field.

as a correct example you can see that
clang::DeclSpec::TypeSpecType field is 6 bits

So, we corrupt values  during save in clang::DeclSpec::SaveWrittenBuiltinSpecs for all after TST_image1d_t.
Btw, due to this TST_error is changed to TST_float128....

Hope it helps,
Vladimir.
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev



_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
_______________________________________________ cfe-dev mailing list [hidden email] http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: invalid bits size for WrittenBuiltinSpecs::Type

Keane, Erich via cfe-dev
Patch to catch this bug if you're curious: https://reviews.llvm.org/D30923

On Mon, Mar 13, 2017 at 4:29 PM, Vladimir Voskresensky via cfe-dev <[hidden email]> wrote:


On 14.03.2017 00:33, Reid Kleckner via cfe-dev wrote:
I think this is something the compiler should catch. I'm writing a generalized warning in clang for it right now.
Yes, I agree. In fact, this is how I got here myself. I ran test
${LLVM_SRC}/llvm/tools/clang/test/Lexer/cxx1z-trigraphs.cpp
using Clank (the Java port of CLang)
https://eurollvm2017.sched.com/event/9wDw/clank-java-port-of-cc-compiler-frontend
 and got Java-assert that reducing from enumerator to 5 bits doesn't fit for TST_error value :-)

Please, send me the changeset when you are done with compiler warning.

Thanks!
Vladimir.



On Mon, Mar 13, 2017 at 12:57 PM, Vladimir Voskresensky via cfe-dev <[hidden email][hidden email]> wrote:
Reid,

May be it's worth to have the same assert for clang::DeclSpec::TypeSpecType?

Thanks,
Vladimir.


On 13.03.2017 21:59, Reid Kleckner via cfe-dev wrote:
Thanks, fixed in r297654.

On Mon, Mar 13, 2017 at 10:35 AM, Vladimir Voskresensky via cfe-dev <[hidden email]> wrote:
Hello Clang Developers,

in file clang/Basic/Specifiers.h there is
   struct clang::WrittenBuiltinSpecs {
     /*DeclSpec::TST*/ unsigned Type  : 5; // << must be *6*
....
  };

"Type" field must be 6 to match DeclSpec::TST which is the same as enum TypeSpecifierType
which has
 TST_error // erroneous type
with value 43 which can not be kept in 5 bits field.

as a correct example you can see that
clang::DeclSpec::TypeSpecType field is 6 bits

So, we corrupt values  during save in clang::DeclSpec::SaveWrittenBuiltinSpecs for all after TST_image1d_t.
Btw, due to this TST_error is changed to TST_float128....

Hope it helps,
Vladimir.
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev



_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
_______________________________________________ cfe-dev mailing list [hidden email] http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev



_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: invalid bits size for WrittenBuiltinSpecs::Type

Keane, Erich via cfe-dev
Thank you!

On 14.03.2017 03:00, Reid Kleckner wrote:
Patch to catch this bug if you're curious: https://reviews.llvm.org/D30923

On Mon, Mar 13, 2017 at 4:29 PM, Vladimir Voskresensky via cfe-dev <[hidden email]> wrote:


On 14.03.2017 00:33, Reid Kleckner via cfe-dev wrote:
I think this is something the compiler should catch. I'm writing a generalized warning in clang for it right now.
Yes, I agree. In fact, this is how I got here myself. I ran test
${LLVM_SRC}/llvm/tools/clang/test/Lexer/cxx1z-trigraphs.cpp
using Clank (the Java port of CLang) https://eurollvm2017.sched.com/event/9wDw/clank-java-port-of-cc-compiler-frontend  and got Java-assert that reducing from enumerator to 5 bits doesn't fit for TST_error value :-) Please, send me the changeset when you are done with compiler warning. Thanks! Vladimir.
On Mon, Mar 13, 2017 at 12:57 PM, Vladimir Voskresensky via cfe-dev <[hidden email]> wrote:
Reid, May be it's worth to have the same assert for clang::DeclSpec::TypeSpecType? Thanks, Vladimir.
On 13.03.2017 21:59, Reid Kleckner via cfe-dev wrote:
Thanks, fixed in r297654.
On Mon, Mar 13, 2017 at 10:35 AM, Vladimir Voskresensky via cfe-dev <[hidden email]> wrote:
Hello Clang Developers, in file clang/Basic/Specifiers.h there is    struct clang::WrittenBuiltinSpecs {      /*DeclSpec::TST*/ unsigned Type  : 5; // << must be *6* ....   }; "Type" field must be 6 to match DeclSpec::TST which is the same as enum TypeSpecifierType which has  TST_error // erroneous type with value 43 which can not be kept in 5 bits field. as a correct example you can see that clang::DeclSpec::TypeSpecType field is 6 bits So, we corrupt values  during save in clang::DeclSpec::SaveWrittenBuiltinSpecs for all after TST_image1d_t. Btw, due to this TST_error is changed to TST_float128.... Hope it helps, Vladimir. _______________________________________________ cfe-dev mailing list [hidden email] http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
_______________________________________________ cfe-dev mailing list [hidden email] http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
_______________________________________________ cfe-dev mailing list [hidden email] http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Loading...