Skip to content

Commit e1a1592

Browse files
committed
Set some explicit return value sizes
1 parent 37ddde9 commit e1a1592

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

src/shims/foreign_items/posix.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -272,72 +272,72 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
272272

273273
"pthread_mutexattr_init" => {
274274
let result = this.pthread_mutexattr_init(args[0])?;
275-
this.write_scalar(Scalar::from_int(result, dest.layout.size), dest)?;
275+
this.write_scalar(Scalar::from_i32(result), dest)?;
276276
}
277277

278278
"pthread_mutexattr_settype" => {
279279
let result = this.pthread_mutexattr_settype(args[0], args[1])?;
280-
this.write_scalar(Scalar::from_int(result, dest.layout.size), dest)?;
280+
this.write_scalar(Scalar::from_i32(result), dest)?;
281281
}
282282

283283
"pthread_mutexattr_destroy" => {
284284
let result = this.pthread_mutexattr_destroy(args[0])?;
285-
this.write_scalar(Scalar::from_int(result, dest.layout.size), dest)?;
285+
this.write_scalar(Scalar::from_i32(result), dest)?;
286286
}
287287

288288
"pthread_mutex_init" => {
289289
let result = this.pthread_mutex_init(args[0], args[1])?;
290-
this.write_scalar(Scalar::from_int(result, dest.layout.size), dest)?;
290+
this.write_scalar(Scalar::from_i32(result), dest)?;
291291
}
292292

293293
"pthread_mutex_lock" => {
294294
let result = this.pthread_mutex_lock(args[0])?;
295-
this.write_scalar(Scalar::from_int(result, dest.layout.size), dest)?;
295+
this.write_scalar(Scalar::from_i32(result), dest)?;
296296
}
297297

298298
"pthread_mutex_trylock" => {
299299
let result = this.pthread_mutex_trylock(args[0])?;
300-
this.write_scalar(Scalar::from_int(result, dest.layout.size), dest)?;
300+
this.write_scalar(Scalar::from_i32(result), dest)?;
301301
}
302302

303303
"pthread_mutex_unlock" => {
304304
let result = this.pthread_mutex_unlock(args[0])?;
305-
this.write_scalar(Scalar::from_int(result, dest.layout.size), dest)?;
305+
this.write_scalar(Scalar::from_i32(result), dest)?;
306306
}
307307

308308
"pthread_mutex_destroy" => {
309309
let result = this.pthread_mutex_destroy(args[0])?;
310-
this.write_scalar(Scalar::from_int(result, dest.layout.size), dest)?;
310+
this.write_scalar(Scalar::from_i32(result), dest)?;
311311
}
312312

313313
"pthread_rwlock_rdlock" => {
314314
let result = this.pthread_rwlock_rdlock(args[0])?;
315-
this.write_scalar(Scalar::from_int(result, dest.layout.size), dest)?;
315+
this.write_scalar(Scalar::from_i32(result), dest)?;
316316
}
317317

318318
"pthread_rwlock_tryrdlock" => {
319319
let result = this.pthread_rwlock_tryrdlock(args[0])?;
320-
this.write_scalar(Scalar::from_int(result, dest.layout.size), dest)?;
320+
this.write_scalar(Scalar::from_i32(result), dest)?;
321321
}
322322

323323
"pthread_rwlock_wrlock" => {
324324
let result = this.pthread_rwlock_wrlock(args[0])?;
325-
this.write_scalar(Scalar::from_int(result, dest.layout.size), dest)?;
325+
this.write_scalar(Scalar::from_i32(result), dest)?;
326326
}
327327

328328
"pthread_rwlock_trywrlock" => {
329329
let result = this.pthread_rwlock_trywrlock(args[0])?;
330-
this.write_scalar(Scalar::from_int(result, dest.layout.size), dest)?;
330+
this.write_scalar(Scalar::from_i32(result), dest)?;
331331
}
332332

333333
"pthread_rwlock_unlock" => {
334334
let result = this.pthread_rwlock_unlock(args[0])?;
335-
this.write_scalar(Scalar::from_int(result, dest.layout.size), dest)?;
335+
this.write_scalar(Scalar::from_i32(result), dest)?;
336336
}
337337

338338
"pthread_rwlock_destroy" => {
339339
let result = this.pthread_rwlock_destroy(args[0])?;
340-
this.write_scalar(Scalar::from_int(result, dest.layout.size), dest)?;
340+
this.write_scalar(Scalar::from_i32(result), dest)?;
341341
}
342342

343343
| "signal"

0 commit comments

Comments
 (0)