@@ -124,24 +124,24 @@ void gs(int s) {
124
124
for (int i = 0 ; i < n_funcs; ++i) {
125
125
int fn = old_func + random () % FUNCSPACING + 1 ;
126
126
funcs[i] = fn;
127
- g (" virtual void fun" ); g (fn); g (" (char *t) { mix((char *)this - t); mix(" ); g (++vfn); gl (" ); }" );
127
+ g (" virtual void fun" ); g (fn); g (" (char *t) { mix(\" vfn this offset \" , (char *)this - t); mix(\" vfn uuid \" , " ); g (++vfn); gl (" ); }" );
128
128
old_func = fn;
129
129
}
130
130
131
131
gl (" public:" );
132
132
gl (" void calc(char *t) {" );
133
133
134
134
// mix in the type number
135
- g (" mix(" ); g (s); gl (" );" );
135
+ g (" mix(\" type num \" , " ); g (s); gl (" );" );
136
136
// mix in the size
137
- g (" mix(sizeof (s" ); g (s); gl (" ));" );
137
+ g (" mix(\" type size \" , sizeof (s" ); g (s); gl (" ));" );
138
138
// mix in the this offset
139
- gl (" mix((char *)this - t);" );
139
+ gl (" mix(\" subobject offset \" , (char *)this - t);" );
140
140
if (n_funcs)
141
141
polymorphic = true ;
142
142
if (polymorphic) {
143
143
// mix in offset to the complete object under construction
144
- gl (" mix(t - (char *)dynamic_cast<void*>(this));" );
144
+ gl (" mix(\" real top v current top \" , t - (char *)dynamic_cast<void*>(this));" );
145
145
}
146
146
147
147
/* check base layout and overrides */
@@ -153,24 +153,24 @@ void gs(int s) {
153
153
/* check dynamic_cast to each direct base */
154
154
for (int i = 0 ; i < n_bases; ++i) {
155
155
g (" if ((char *)dynamic_cast<s" ); g (bases[i]); gl (" *>(this))" );
156
- g (" mix(t - (char *)dynamic_cast<s" ); g (bases[i]); gl (" *>(this));" );
157
- gl (" else mix(666);" );
156
+ g (" mix(\" base dyn cast \" , t - (char *)dynamic_cast<s" ); g (bases[i]); gl (" *>(this));" );
157
+ gl (" else mix(\" no dyncast \" , 666);" );
158
158
}
159
159
}
160
160
161
161
/* check field layout */
162
162
for (int i = 0 ; i < n_fields; ++i) {
163
- g (" mix((char *)&field" ); g (i); gl (" - (char *)this);" );
163
+ g (" mix(\" field offset \" , (char *)&field" ); g (i); gl (" - (char *)this);" );
164
164
}
165
165
if (n_fields == 0 )
166
- gl (" mix(42);" );
166
+ gl (" mix(\" no fields \" , 42);" );
167
167
168
168
/* check functions */
169
169
for (int i = 0 ; i < n_funcs; ++i) {
170
170
g (" fun" ); g (funcs[i]); gl (" (t);" );
171
171
}
172
172
if (n_funcs == 0 )
173
- gl (" mix(13);" );
173
+ gl (" mix(\" no funcs \" , 13);" );
174
174
175
175
gl (" }" );
176
176
@@ -204,10 +204,10 @@ main(int argc, char **argv) {
204
204
gl (" extern \" C\" int printf(const char *...);" );
205
205
gl (" " );
206
206
gl (" long long sum;" );
207
- gl (" void mix(long long i) {" );
207
+ gl (" void mix(const char *desc, long long i) {" );
208
208
// If this ever becomes too slow, we can remove this after we improve the
209
209
// mixing function
210
- gl (" printf(\" %llx \\ n\" , i);" );
210
+ gl (" printf(\" %s: %lld \\ n\" , desc , i);" );
211
211
gl (" sum += ((sum ^ i) << 3) + (sum<<1) - i;" );
212
212
gl (" }" );
213
213
gl (" " );
0 commit comments