www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - Crash on template compile

reply Sean Kelly <sean f4.ca> writes:
If I remove the "volatile" everything works fine.

# template load( T, int i, size_t sizeofT : 4 = T.sizeof )
# {
#     T load( inout T val )
#     {
#         volatile asm
#         {
#             naked;
#             mov EAX, [EAX];
#             ret;
#         }
#     }
# }
# 
# void main()
# {
#     int i;
#     load!(int,1)(i);
#     load!(int,2)(i);
# }
Jul 31 2005
parent =?UTF-8?B?VGhvbWFzIEvDvGhuZQ==?= writes:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Sean Kelly schrieb:

 If I remove the "volatile" everything works fine.
 
 # template load( T, int i, size_t sizeofT : 4 = T.sizeof )
 # {
 #     T load( inout T val )
 #     {
 #         volatile asm
 #         {
 #             naked;
 #             mov EAX, [EAX];
 #             ret;
 #         }
 #     }
 # }
 # 
 # void main()
 # {
 #     int i;
 #     load!(int,1)(i);
 #     load!(int,2)(i);
 # }

Added to DStress as http://dstress.kuehne.cn/run/v/volatile_01_A.d http://dstress.kuehne.cn/run/v/volatile_01_B.d Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFC7+/73w+/yD4P9tIRAtjMAJ9VIPD7IcwiOoFNthe6rMoWzqlwNACfQTJo CIL4dNDyRLpzqzZZN2pzBdo= =w8YL -----END PGP SIGNATURE-----
Aug 02 2005