1 Star 0 Fork 55

wangjunqiang/firefox

forked from src-openEuler/firefox 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
Bug-1680166-GCC-is-smarter-than-clang-so-ignore-the-warning-properly.patch 1.63 KB
一键复制 编辑 原始数据 按行查看 历史
lingsheng 提交于 2021-07-08 15:18 +08:00 . Fix firefox video tab crash with rust 1.51
# HG changeset patch
# User Emilio Cobos Álvarez <emilio@crisal.io>
# Date 1606915787 -3600
# Node ID 8aa3952dd7208d96648ea171f814c748ec027630
# Parent ff436849850a87dfa3db032e80eaba5e5a3536f4
Bug 1680166 - GCC is smarter than clang, so ignore the warning properly. a=RyanVM
diff --git a/security/sandbox/linux/gtest/TestBroker.cpp b/security/sandbox/linux/gtest/TestBroker.cpp
--- a/security/sandbox/linux/gtest/TestBroker.cpp
+++ b/security/sandbox/linux/gtest/TestBroker.cpp
@@ -212,23 +212,27 @@ TEST_F(SandboxBrokerTest, Access) {
TEST_F(SandboxBrokerTest, Stat) {
statstruct realStat, brokeredStat;
ASSERT_EQ(0, statsyscall("/dev/null", &realStat)) << "Shouldn't ever fail!";
EXPECT_EQ(0, Stat("/dev/null", &brokeredStat));
EXPECT_EQ(realStat.st_ino, brokeredStat.st_ino);
EXPECT_EQ(realStat.st_rdev, brokeredStat.st_rdev);
- // Add some indirection to avoid -Wnonnull warnings.
- [&](const char* aPath) {
- EXPECT_EQ(-1, statsyscall(aPath, &realStat));
- EXPECT_EQ(errno, EFAULT);
+#if defined(__clang__) || defined(__GNUC__)
+# pragma GCC diagnostic push
+# pragma GCC diagnostic ignored "-Wnonnull"
+#endif
+ EXPECT_EQ(-1, statsyscall(nullptr, &realStat));
+ EXPECT_EQ(errno, EFAULT);
- EXPECT_EQ(-EFAULT, Stat(aPath, &brokeredStat));
- }(nullptr);
+ EXPECT_EQ(-EFAULT, Stat(nullptr, &brokeredStat));
+#if defined(__clang__) || defined(__GNUC__)
+# pragma GCC diagnostic pop
+#endif
EXPECT_EQ(-ENOENT, Stat("/var/empty/qwertyuiop", &brokeredStat));
EXPECT_EQ(-EACCES, Stat("/dev", &brokeredStat));
EXPECT_EQ(0, Stat("/proc/self", &brokeredStat));
EXPECT_TRUE(S_ISDIR(brokeredStat.st_mode));
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/geasscore/firefox.git
git@gitee.com:geasscore/firefox.git
geasscore
firefox
firefox
master

搜索帮助