Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
27e302dc
T
Third Party Harfbuzz
项目概览
OpenHarmony
/
Third Party Harfbuzz
1 年多 前同步成功
通知
0
Star
18
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Third Party Harfbuzz
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
27e302dc
编写于
5月 05, 2010
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
I keep changing my mind about this
上级
39840474
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
10 addition
and
20 deletion
+10
-20
src/hb-open-type-private.hh
src/hb-open-type-private.hh
+10
-20
未找到文件。
src/hb-open-type-private.hh
浏览文件 @
27e302dc
...
...
@@ -195,7 +195,7 @@ struct hb_sanitize_context_t
this
->
start
,
this
->
end
,
ret
?
"pass"
:
"FAIL"
);
return
ret
;
return
likely
(
ret
)
;
}
inline
bool
check_array
(
const
char
*
base
,
unsigned
int
record_size
,
unsigned
int
len
)
const
...
...
@@ -211,7 +211,7 @@ struct hb_sanitize_context_t
this
->
start
,
this
->
end
,
!
overflows
?
"does not overflow"
:
"OVERFLOWS FAIL"
);
return
likely
(
!
overflows
)
&&
this
->
check
(
base
,
record_size
*
len
);
return
likely
(
!
overflows
&&
this
->
check
(
base
,
record_size
*
len
)
);
}
inline
bool
can_edit
(
const
char
*
base
HB_UNUSED
,
unsigned
int
len
HB_UNUSED
)
...
...
@@ -230,21 +230,11 @@ struct hb_sanitize_context_t
return
this
->
writable
;
}
inline
const
char
*
get_start
(
void
)
const
{
return
start
;
}
inline
const
char
*
get_end
(
void
)
const
{
return
end
;
}
inline
bool
is_writable
(
void
)
const
{
return
writable
;
}
inline
unsigned
int
get_edit_count
(
void
)
const
{
return
this
->
edit_count
;
}
inline
void
reset_edit_count
(
void
)
{
this
->
edit_count
=
0
;
}
public:
unsigned
int
debug_depth
;
private:
const
char
*
start
,
*
end
;
bool
writable
;
unsigned
int
edit_count
;
hb_blob_t
*
blob
;
unsigned
int
debug_depth
;
};
...
...
@@ -275,28 +265,28 @@ struct Sanitizer
context
->
init
(
blob
);
Type
*
t
=
CastP
<
Type
>
(
const_cast
<
char
*>
(
context
->
get_start
()
));
Type
*
t
=
CastP
<
Type
>
(
const_cast
<
char
*>
(
context
->
start
));
sane
=
t
->
sanitize
(
context
);
if
(
sane
)
{
if
(
context
->
get_edit_count
()
)
{
if
(
context
->
edit_count
)
{
if
(
HB_DEBUG_SANITIZE
)
fprintf
(
stderr
,
"Sanitizer %p passed first round with %d edits; doing a second round %s
\n
"
,
blob
,
context
->
get_edit_count
()
,
HB_FUNC
);
blob
,
context
->
edit_count
,
HB_FUNC
);
/* sanitize again to ensure no toe-stepping */
context
->
reset_edit_count
()
;
context
->
edit_count
=
0
;
sane
=
t
->
sanitize
(
context
);
if
(
context
->
get_edit_count
()
)
{
if
(
context
->
edit_count
)
{
if
(
HB_DEBUG_SANITIZE
)
fprintf
(
stderr
,
"Sanitizer %p requested %d edits in second round; FAILLING %s
\n
"
,
blob
,
context
->
get_edit_count
()
,
HB_FUNC
);
blob
,
context
->
edit_count
,
HB_FUNC
);
sane
=
false
;
}
}
context
->
finish
();
}
else
{
unsigned
int
edit_count
=
context
->
get_edit_count
()
;
unsigned
int
edit_count
=
context
->
edit_count
;
context
->
finish
();
if
(
edit_count
&&
!
hb_blob_is_writable
(
blob
)
&&
hb_blob_try_writable
(
blob
))
{
/* ok, we made it writable by relocating. try again */
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录