Skip to content

Commit

Permalink
Merge pull request #947 from donc/heisenbug7478
Browse files Browse the repository at this point in the history
 7478 stack overflow compiling with -deps -release -inline -noboundscheck
  • Loading branch information
WalterBright committed May 16, 2012
2 parents 23bb1ac + e0739df commit c029f71
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions src/mars.c
Expand Up @@ -1314,24 +1314,13 @@ int tryMain(int argc, char *argv[])
if (global.errors)
fatal();

if (global.params.moduleDeps != NULL)
{
assert(global.params.moduleDepsFile != NULL);

File deps(global.params.moduleDepsFile);
OutBuffer* ob = global.params.moduleDeps;
deps.setbuffer((void*)ob->data, ob->offset);
deps.writev();
}


// Scan for functions to inline
if (global.params.useInline)
{
/* The problem with useArrayBounds and useAssert is that the
* module being linked to may not have generated them, so if
* we inline functions from those modules, the symbols for them will
* not be found at link time.
* We must do this BEFORE generating the .deps file!
*/
if (!global.params.useArrayBounds && !global.params.useAssert)
{
Expand All @@ -1347,7 +1336,21 @@ int tryMain(int argc, char *argv[])
if (global.errors)
fatal();
}
}

if (global.params.moduleDeps != NULL)
{
assert(global.params.moduleDepsFile != NULL);

File deps(global.params.moduleDepsFile);
OutBuffer* ob = global.params.moduleDeps;
deps.setbuffer((void*)ob->data, ob->offset);
deps.writev();
}

// Scan for functions to inline
if (global.params.useInline)
{
for (size_t i = 0; i < modules.dim; i++)
{
m = modules[i];
Expand Down

0 comments on commit c029f71

Please sign in to comment.