Addr client_SP; /* client stack base (initial SP) */
Addr clstack_start; /* client_SP rounded down to nearest page */
Int i;
- Bool have_exename;
Word client_argv;
vg_assert(VG_IS_PAGE_ALIGNED(clstack_end+1));
/* first of all, work out how big the client stack will be */
stringsize = 0;
- have_exename = VG_(args_the_exename) != NULL;
/* paste on the extra args if the loader needs them (ie, the #!
interpreter and its argument) */
}
/* now scan the args we're given... */
- if (have_exename) {
- stringsize += VG_(strlen)( VG_(args_the_exename) ) + 1;
- }
+ stringsize += VG_(strlen)( VG_(args_the_exename) ) + 1;
for (i = 0; i < VG_(sizeXA)( VG_(args_for_client) ); i++) {
argc++;
/* OK, now we know how big the client stack is */
used_stacksize =
sizeof(Word) + /* argc */
- (have_exename ? sizeof(HChar **) : 0) + /* argc[0] == exename */
+ sizeof(HChar **) + /* argc[0] == exename */
sizeof(HChar **)*argc + /* argv */
sizeof(HChar **) + /* terminal NULL */
sizeof(HChar **)*envc + /* envp */
ptr = (Addr*)client_SP;
/* --- client argc --- */
- *ptr++ = argc + (have_exename ? 1 : 0);
+ *ptr++ = argc + 1;
/* --- client argv --- */
client_argv = (Word)ptr;
*ptr++ = (Addr)copy_str(&strtab, info->interp_args);
}
- if (have_exename) {
- *ptr++ = (Addr)copy_str(&strtab, VG_(args_the_exename));
- }
+ *ptr++ = (Addr)copy_str(&strtab, VG_(args_the_exename));
for (i = 0; i < VG_(sizeXA)( VG_(args_for_client) ); i++) {
*ptr++ = (Addr)copy_str(