So it's pointless to test or assert their return values.
Remove code doing so.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14528
new_table = (BB**) CLG_MALLOC("cl.bb.rbt.1",
new_size * sizeof(BB*));
- if (!new_table) return;
-
for (i = 0; i < new_size; i++)
new_table[i] = NULL;
new_table = (BBCC**) CLG_MALLOC("cl.bbcc.rbh.1",
new_size * sizeof(BBCC*));
- if (!new_table) return;
-
for (i = 0; i < new_size; i++)
new_table[i] = NULL;
new_table = (Context**) CLG_MALLOC("cl.context.rct.1",
new_size * sizeof(Context*));
- if (!new_table) return;
-
for (i = 0; i < new_size; i++)
new_table[i] = NULL;
/* allocate space big enough for final filenames */
filename = (HChar*) CLG_MALLOC("cl.dump.init_dumps.2",
VG_(strlen)(out_file)+32);
- CLG_ASSERT(filename != 0);
/* Make sure the output base file can be written.
* This is used for the dump at program termination.
new_table = (jCC**) CLG_MALLOC("cl.jumps.rjt.1",
new_size * sizeof(jCC*));
- if (!new_table) return;
-
for (i = 0; i < new_size; i++)
new_table[i] = NULL;
n_starts = 1;
while (True) {
starts = VG_(malloc)( "main.gss.1", n_starts * sizeof(Addr) );
- if (starts == NULL)
- break;
r = VG_(am_get_segment_starts)( starts, n_starts );
if (r >= 0)
break;
n_starts *= 2;
}
- if (starts == NULL) {
- *n_acquired = 0;
- return NULL;
- }
-
*n_acquired = r;
return starts;
}
&& (!(stat_buf.mode & VKI_S_IWOTH))) {
if ( stat_buf.size > 0 ) {
f_clo = VG_(malloc)("commandline.rdv.1", stat_buf.size+1);
- vg_assert(f_clo);
n = VG_(read)(sr_Res(fd), f_clo, stat_buf.size);
if (n == -1) n = 0;
vg_assert(n >= 0 && n <= stat_buf.size+1);
buf = VG_(malloc)( "coredump-elf.mec.1",
VG_(strlen)(coreext) + VG_(strlen)(basename)
+ 100/*for the two %ds. */ );
- vg_assert(buf);
for(;;) {
Int oflags = VKI_O_CREAT|VKI_O_WRONLY|VKI_O_EXCL|VKI_O_TRUNC;
+ sizeof(VG_PLATFORM) + 16;
Int preload_string_len = preload_core_path_len + preload_tool_path_len;
HChar* preload_string = VG_(malloc)("initimg-darwin.sce.1", preload_string_len);
- vg_assert(preload_string);
/* Determine if there's a vgpreload_<tool>_<platform>.so file, and setup
preload_string. */
preload_tool_path = VG_(malloc)("initimg-darwin.sce.2", preload_tool_path_len);
- vg_assert(preload_tool_path);
VG_(snprintf)(preload_tool_path, preload_tool_path_len,
"%s/vgpreload_%s-%s.so", VG_(libdir), toolname, VG_PLATFORM);
if (VG_(access)(preload_tool_path, True/*r*/, False/*w*/, False/*x*/) == 0) {
/* Allocate a new space */
ret = VG_(malloc) ("initimg-darwin.sce.3",
sizeof(HChar *) * (envc+2+1)); /* 2 new entries + NULL */
- vg_assert(ret);
/* copy it over */
for (cpp = ret; *origenv; )
if (VG_(memcmp)(*cpp, ld_preload, ld_preload_len) == 0) {
Int len = VG_(strlen)(*cpp) + preload_string_len;
HChar *cp = VG_(malloc)("initimg-darwin.sce.4", len);
- vg_assert(cp);
VG_(snprintf)(cp, len, "%s%s:%s",
ld_preload, preload_string, (*cpp)+ld_preload_len);
if (VG_(memcmp)(*cpp, dyld_cache, dyld_cache_len) == 0) {
Int len = dyld_cache_len + VG_(strlen)(dyld_cache_value) + 1;
HChar *cp = VG_(malloc)("initimg-darwin.sce.4.2", len);
- vg_assert(cp);
VG_(snprintf)(cp, len, "%s%s", dyld_cache, dyld_cache_value);
if (!ld_preload_done) {
Int len = ld_preload_len + preload_string_len;
HChar *cp = VG_(malloc) ("initimg-darwin.sce.5", len);
- vg_assert(cp);
VG_(snprintf)(cp, len, "%s%s", ld_preload, preload_string);
if (!dyld_cache_done) {
Int len = dyld_cache_len + VG_(strlen)(dyld_cache_value) + 1;
HChar *cp = VG_(malloc) ("initimg-darwin.sce.5.2", len);
- vg_assert(cp);
VG_(snprintf)(cp, len, "%s%s", dyld_cache, dyld_cache_value);
*/
static HChar** setup_client_env ( HChar** origenv, const HChar* toolname)
{
+ vg_assert(origenv);
+ vg_assert(toolname);
+
const HChar* preload_core = "vgpreload_core";
const HChar* ld_preload = "LD_PRELOAD=";
const HChar* v_launcher = VALGRIND_LAUNCHER "=";
Int preload_string_len = preload_core_path_len + preload_tool_path_len;
HChar* preload_string = VG_(malloc)("initimg-linux.sce.1",
preload_string_len);
- vg_assert(origenv);
- vg_assert(toolname);
- vg_assert(preload_string);
-
/* Determine if there's a vgpreload_<tool>_<platform>.so file, and setup
preload_string. */
preload_tool_path = VG_(malloc)("initimg-linux.sce.2", preload_tool_path_len);
- vg_assert(preload_tool_path);
VG_(snprintf)(preload_tool_path, preload_tool_path_len,
"%s/vgpreload_%s-%s.so", VG_(libdir), toolname, VG_PLATFORM);
if (VG_(access)(preload_tool_path, True/*r*/, False/*w*/, False/*x*/) == 0) {
/* Allocate a new space */
ret = VG_(malloc) ("initimg-linux.sce.3",
sizeof(HChar *) * (envc+1+1)); /* 1 new entry + NULL */
- vg_assert(ret);
/* copy it over */
for (cpp = ret; *origenv; ) {
if (VG_(memcmp)(*cpp, ld_preload, ld_preload_len) == 0) {
Int len = VG_(strlen)(*cpp) + preload_string_len;
HChar *cp = VG_(malloc)("initimg-linux.sce.4", len);
- vg_assert(cp);
VG_(snprintf)(cp, len, "%s%s:%s",
ld_preload, preload_string, (*cpp)+ld_preload_len);
if (!ld_preload_done) {
Int len = ld_preload_len + preload_string_len;
HChar *cp = VG_(malloc) ("initimg-linux.sce.5", len);
- vg_assert(cp);
VG_(snprintf)(cp, len, "%s%s", ld_preload, preload_string);
struct sched_lock *p;
p = VG_(malloc)("sched_lock", sizeof(*p));
- if (p) {
- // The futex syscall requires that a futex takes four bytes.
- vg_assert(sizeof(p->futex[0]) == 4);
-
- p->head = 0;
- p->tail = 0;
- VG_(memset)((void*)p->futex, 0, sizeof(p->futex));
- p->owner = 0;
- }
+
+ // The futex syscall requires that a futex takes four bytes.
+ vg_assert(sizeof(p->futex[0]) == 4);
+
+ p->head = 0;
+ p->tail = 0;
+ VG_(memset)((void*)p->futex, 0, sizeof(p->futex));
+ p->owner = 0;
+
INNER_REQUEST(ANNOTATE_RWLOCK_CREATE(p));
INNER_REQUEST(ANNOTATE_BENIGN_RACE_SIZED(&p->futex, sizeof(p->futex), ""));
return p;
// allocate
argv = VG_(malloc)( "di.syswrap.pre_sys_execve.1",
(tot_args+1) * sizeof(HChar*) );
- vg_assert(argv);
// copy
j = 0;
argv[j++] = launcher_basename;
// allocate
argv = VG_(malloc)( "di.syswrap.pre_sys_execve.1",
(tot_args+1) * sizeof(HChar*) );
- if (argv == 0) goto hosed;
// copy
j = 0;
argv[j++] = launcher_basename;
struct elfinfo *e = VG_(malloc)("ume.re.1", sizeof(*e));
Int phsz;
- vg_assert(e);
e->fd = fd;
sres = VG_(pread)(fd, &e->e, sizeof(e->e), 0);
phsz = sizeof(ESZ(Phdr)) * e->e.e_phnum;
e->p = VG_(malloc)("ume.re.2", phsz);
- vg_assert(e->p);
sres = VG_(pread)(fd, e->p, phsz, e->e.e_phoff);
if (sr_isError(sres) || sr_Res(sres) != phsz) {
Int intfd;
Int baseaddr_set;
- vg_assert(buf);
VG_(pread)(fd, buf, ph->p_filesz, ph->p_offset);
buf[ph->p_filesz] = '\0';
s_max_segments_alive_count = s_segments_alive_count;
sg = VG_(malloc)("drd.segment.sn.1", sizeof(*sg));
- tl_assert(sg);
sg_init(sg, creator, created);
if (DRD_(g_sg_list)) {
DRD_(g_sg_list)->g_prev = sg;
void* p;
tl_assert(n > 0);
p = VG_(malloc)( cc, n );
- tl_assert(p);
return p;
}
void* p;
tl_assert(n > 0);
p = VG_(malloc)( cc, n );
- tl_assert(p);
VG_(memset)(p, 0, n);
return p;
}
return copy;
} else {
copy = HG_(strdup)("hg.sts.2", str);
- tl_assert(copy);
VG_(addToFM)( string_table, (UWord)copy, (UWord)copy );
return copy;
}
UWord nLocks = HG_(cardinalityWS)(univ_lsets, lockset);
Lock** lockPs = HG_(zalloc)( "hg.eWSiLPa",
(nLocks+1) * sizeof(Lock*) );
- tl_assert(lockPs);
tl_assert(lockPs[nLocks] == NULL); /* pre-NULL terminated */
UWord* lockNs = NULL;
UWord nLockNs = 0;
tl_assert(map_threads == NULL);
map_threads = HG_(zalloc)( "hg.ids.1", VG_N_THREADS * sizeof(Thread*) );
- tl_assert(map_threads != NULL);
tl_assert(sizeof(Addr) == sizeof(UWord));
tl_assert(map_locks == NULL);
static Bar* new_Bar ( void ) {
Bar* bar = HG_(zalloc)( "hg.nB.1 (new_Bar)", sizeof(Bar) );
- tl_assert(bar);
/* all fields are zero */
tl_assert(bar->initted == False);
return bar;
new_size = sm->linesF_size==0 ? 1 : 2 * sm->linesF_size;
nyu = HG_(zalloc)( "libhb.aFfw.1 (LineF storage)",
new_size * sizeof(LineF) );
- tl_assert(nyu);
stats__secmap_linesF_allocd += (new_size - sm->linesF_size);
stats__secmap_linesF_bytes += (new_size - sm->linesF_size)
tl_assert(!contextTab);
contextTab = HG_(zalloc)( "libhb.event_map_init.2 (context table)",
N_RCEC_TAB * sizeof(RCEC*) );
- tl_assert(contextTab);
for (i = 0; i < N_RCEC_TAB; i++)
contextTab[i] = NULL;