MCPcopy Create free account
hub / github.com/csmith-project/csmith / make_random_nonzero

Method make_random_nonzero

src/Constant.cpp:416–425  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

414}
415
416Constant*
417Constant::make_random_nonzero(const Type* type)
418{
419 string v = GenerateRandomConstant(type);
420 ERROR_GUARD(NULL);
421 while (StringUtils::str2int(v) == 0) {
422 v = GenerateRandomConstant(type);
423 }
424 return new Constant(type, v);
425}
426
427/*
428 * Return a `Constant' representing the integer value `v'. Note that the

Callers

nothing calls this directly

Calls 1

GenerateRandomConstantFunction · 0.85

Tested by

no test coverage detected