Index: modules/block/block.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/block/block.module,v
retrieving revision 1.421
diff -u -p -r1.421 block.module
--- modules/block/block.module	13 May 2010 07:53:02 -0000	1.421
+++ modules/block/block.module	31 May 2010 23:52:20 -0000
@@ -242,6 +242,7 @@ function block_page_build(&$page) {
         $page[$region] = $blocks;
       }
     }
+    // Clear the static cache here to allow modules to alter the blocks list
+    // differently in different contexts. For example, Overlay module only
+    // alters the block list to be shown in the overlay, not the one for the
+    // parent page. We do not clear the cache in block_list() because that is
+    // called once per region for every page view.
+    drupal_static_reset('block_list');
   }
   else {
     // Append region description if we are rendering the regions demo page.
