Bug 823533 - Reject plugins with a different architecture in 32bit Mac builds. r=bsmedberg,smichaud
authorGeorg Fritzsche <georg.fritzsche@googlemail.com>
Thu, 20 Dec 2012 21:30:19 +0100
changeset 125988 d671838aeb16e176c19d03f1df2f3bab60c199fe
parent 125987 79d9e21392276cdfc305241381fba7dfd6705a91
child 125989 aa42fc5b6396dab8d58ceeaac40891f88e239d36
push id2151
push userlsblakk@mozilla.com
push dateTue, 19 Feb 2013 18:06:57 +0000
treeherdermozilla-beta@4952e88741ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbsmedberg, smichaud
bugs823533
milestone20.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 823533 - Reject plugins with a different architecture in 32bit Mac builds. r=bsmedberg,smichaud
dom/plugins/base/nsPluginsDirDarwin.cpp
--- a/dom/plugins/base/nsPluginsDirDarwin.cpp
+++ b/dom/plugins/base/nsPluginsDirDarwin.cpp
@@ -375,20 +375,25 @@ static bool IsCompatibleArch(nsIFile *fi
       }
 
       uint32_t pluginLibArchitectures;
       nsresult rv = mozilla::ipc::GeckoChildProcessHost::GetArchitecturesForBinary(executablePath, &pluginLibArchitectures);
       if (NS_FAILED(rv)) {
         return false;
       }
 
-      uint32_t containerArchitectures = mozilla::ipc::GeckoChildProcessHost::GetSupportedArchitecturesForProcessType(GeckoProcessType_Plugin);
+      uint32_t supportedArchitectures =
+#ifdef __LP64__
+          mozilla::ipc::GeckoChildProcessHost::GetSupportedArchitecturesForProcessType(GeckoProcessType_Plugin);
+#else
+          base::GetCurrentProcessArchitecture();
+#endif
 
       // Consider the plugin architecture valid if there is any overlap in the masks.
-      isPluginFile = !!(containerArchitectures & pluginLibArchitectures);
+      isPluginFile = !!(supportedArchitectures & pluginLibArchitectures);
     }
     ::CFRelease(pluginBundle);
   }
 
   ::CFRelease(pluginURL);
   return isPluginFile;
 }