+2019-03-09 Iain Buclaw <ibuclaw@gdcproject.org>
+
+ PR d/89041
+ * d-codegen.cc (get_frame_for_symbol): Delegate literals defined in
+ global scope don't have a frame pointer.
+
2019-03-01 Iain Buclaw <ibuclaw@gdcproject.org>
* d-builtins.cc (d_init_versions): Add CppRuntime_Gcc as predefined
fdparent = (FuncDeclaration *) sym;
}
- gcc_assert (fdparent != NULL);
+ /* Not a nested function, there is no frame pointer to pass. */
+ if (fdparent == NULL)
+ {
+ /* Only delegate literals report as being nested, even if they are in
+ global scope. */
+ gcc_assert (fd && fd->isFuncLiteralDeclaration ());
+ return null_pointer_node;
+ }
+
+ gcc_assert (thisfd != NULL);
if (thisfd != fdparent)
{
if (!thisfd->vthis)
{
error_at (make_location_t (sym->loc),
- "is a nested function and cannot be accessed from %qs",
- thisfd->toChars ());
+ "%qs is a nested function and cannot be accessed from %qs",
+ fd->toPrettyChars (), thisfd->toPrettyChars ());
return null_pointer_node;
}