Index: modules/user/user.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/user/user.module,v
retrieving revision 1.1083
diff -u -p -r1.1083 user.module
--- modules/user/user.module	20 Nov 2009 06:12:45 -0000	1.1083
+++ modules/user/user.module	20 Nov 2009 18:48:24 -0000
@@ -690,6 +690,12 @@ function user_access($string, $account =
 
   // User #1 has all privileges:
   if ($account->uid == 1) {
+    // To avoid calling drupal_static() unnecessarily on every invocation,
+    // initialize $perm. Since $perm is initialized automatically for users
+    // other than user 1, this check is only needed for user 1.
+    if (!isset($perm)) {
+      $perm = array();
+    }
     return TRUE;
   }
 
