Move TRACE_DISPATCH after may_recurse()
Such that we don't get memory access issues if DEBUG_SANITIZE is on and may_recurse() returns false.
This commit is contained in:
parent
84b9a632ed
commit
be8a87c453
|
@ -1324,8 +1324,8 @@ struct ClipBox
|
||||||
template <typename context_t, typename ...Ts>
|
template <typename context_t, typename ...Ts>
|
||||||
typename context_t::return_t dispatch (context_t *c, Ts&&... ds) const
|
typename context_t::return_t dispatch (context_t *c, Ts&&... ds) const
|
||||||
{
|
{
|
||||||
|
if (unlikely (!c->may_dispatch (this, &u.format))) return c->no_dispatch_return_value ();
|
||||||
TRACE_DISPATCH (this, u.format);
|
TRACE_DISPATCH (this, u.format);
|
||||||
if (unlikely (!c->may_dispatch (this, &u.format))) return_trace (c->no_dispatch_return_value ());
|
|
||||||
switch (u.format) {
|
switch (u.format) {
|
||||||
case 1: return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
|
case 1: return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
|
||||||
case 2: return_trace (c->dispatch (u.format2, std::forward<Ts> (ds)...));
|
case 2: return_trace (c->dispatch (u.format2, std::forward<Ts> (ds)...));
|
||||||
|
@ -1527,8 +1527,8 @@ struct Paint
|
||||||
template <typename context_t, typename ...Ts>
|
template <typename context_t, typename ...Ts>
|
||||||
typename context_t::return_t dispatch (context_t *c, Ts&&... ds) const
|
typename context_t::return_t dispatch (context_t *c, Ts&&... ds) const
|
||||||
{
|
{
|
||||||
|
if (unlikely (!c->may_dispatch (this, &u.format))) return c->no_dispatch_return_value ();
|
||||||
TRACE_DISPATCH (this, u.format);
|
TRACE_DISPATCH (this, u.format);
|
||||||
if (unlikely (!c->may_dispatch (this, &u.format))) return_trace (c->no_dispatch_return_value ());
|
|
||||||
switch (u.format) {
|
switch (u.format) {
|
||||||
case 1: return_trace (c->dispatch (u.paintformat1, std::forward<Ts> (ds)...));
|
case 1: return_trace (c->dispatch (u.paintformat1, std::forward<Ts> (ds)...));
|
||||||
case 2: return_trace (c->dispatch (u.paintformat2, std::forward<Ts> (ds)...));
|
case 2: return_trace (c->dispatch (u.paintformat2, std::forward<Ts> (ds)...));
|
||||||
|
|
|
@ -19,8 +19,8 @@ struct CursivePos
|
||||||
template <typename context_t, typename ...Ts>
|
template <typename context_t, typename ...Ts>
|
||||||
typename context_t::return_t dispatch (context_t *c, Ts&&... ds) const
|
typename context_t::return_t dispatch (context_t *c, Ts&&... ds) const
|
||||||
{
|
{
|
||||||
|
if (unlikely (!c->may_dispatch (this, &u.format))) return c->no_dispatch_return_value ();
|
||||||
TRACE_DISPATCH (this, u.format);
|
TRACE_DISPATCH (this, u.format);
|
||||||
if (unlikely (!c->may_dispatch (this, &u.format))) return_trace (c->no_dispatch_return_value ());
|
|
||||||
switch (u.format) {
|
switch (u.format) {
|
||||||
case 1: return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
|
case 1: return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
|
||||||
default:return_trace (c->default_return_value ());
|
default:return_trace (c->default_return_value ());
|
||||||
|
|
|
@ -22,8 +22,8 @@ struct MarkBasePos
|
||||||
template <typename context_t, typename ...Ts>
|
template <typename context_t, typename ...Ts>
|
||||||
typename context_t::return_t dispatch (context_t *c, Ts&&... ds) const
|
typename context_t::return_t dispatch (context_t *c, Ts&&... ds) const
|
||||||
{
|
{
|
||||||
|
if (unlikely (!c->may_dispatch (this, &u.format))) return c->no_dispatch_return_value ();
|
||||||
TRACE_DISPATCH (this, u.format);
|
TRACE_DISPATCH (this, u.format);
|
||||||
if (unlikely (!c->may_dispatch (this, &u.format))) return_trace (c->no_dispatch_return_value ());
|
|
||||||
switch (u.format) {
|
switch (u.format) {
|
||||||
case 1: return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
|
case 1: return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
|
||||||
#ifndef HB_NO_BEYOND_64K
|
#ifndef HB_NO_BEYOND_64K
|
||||||
|
|
|
@ -22,8 +22,8 @@ struct MarkLigPos
|
||||||
template <typename context_t, typename ...Ts>
|
template <typename context_t, typename ...Ts>
|
||||||
typename context_t::return_t dispatch (context_t *c, Ts&&... ds) const
|
typename context_t::return_t dispatch (context_t *c, Ts&&... ds) const
|
||||||
{
|
{
|
||||||
|
if (unlikely (!c->may_dispatch (this, &u.format))) return c->no_dispatch_return_value ();
|
||||||
TRACE_DISPATCH (this, u.format);
|
TRACE_DISPATCH (this, u.format);
|
||||||
if (unlikely (!c->may_dispatch (this, &u.format))) return_trace (c->no_dispatch_return_value ());
|
|
||||||
switch (u.format) {
|
switch (u.format) {
|
||||||
case 1: return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
|
case 1: return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
|
||||||
#ifndef HB_NO_BEYOND_64K
|
#ifndef HB_NO_BEYOND_64K
|
||||||
|
|
|
@ -22,8 +22,8 @@ struct MarkMarkPos
|
||||||
template <typename context_t, typename ...Ts>
|
template <typename context_t, typename ...Ts>
|
||||||
typename context_t::return_t dispatch (context_t *c, Ts&&... ds) const
|
typename context_t::return_t dispatch (context_t *c, Ts&&... ds) const
|
||||||
{
|
{
|
||||||
|
if (unlikely (!c->may_dispatch (this, &u.format))) return c->no_dispatch_return_value ();
|
||||||
TRACE_DISPATCH (this, u.format);
|
TRACE_DISPATCH (this, u.format);
|
||||||
if (unlikely (!c->may_dispatch (this, &u.format))) return_trace (c->no_dispatch_return_value ());
|
|
||||||
switch (u.format) {
|
switch (u.format) {
|
||||||
case 1: return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
|
case 1: return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
|
||||||
#ifndef HB_NO_BEYOND_64K
|
#ifndef HB_NO_BEYOND_64K
|
||||||
|
|
|
@ -25,8 +25,8 @@ struct PairPos
|
||||||
template <typename context_t, typename ...Ts>
|
template <typename context_t, typename ...Ts>
|
||||||
typename context_t::return_t dispatch (context_t *c, Ts&&... ds) const
|
typename context_t::return_t dispatch (context_t *c, Ts&&... ds) const
|
||||||
{
|
{
|
||||||
|
if (unlikely (!c->may_dispatch (this, &u.format))) return c->no_dispatch_return_value ();
|
||||||
TRACE_DISPATCH (this, u.format);
|
TRACE_DISPATCH (this, u.format);
|
||||||
if (unlikely (!c->may_dispatch (this, &u.format))) return_trace (c->no_dispatch_return_value ());
|
|
||||||
switch (u.format) {
|
switch (u.format) {
|
||||||
case 1: return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
|
case 1: return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
|
||||||
case 2: return_trace (c->dispatch (u.format2, std::forward<Ts> (ds)...));
|
case 2: return_trace (c->dispatch (u.format2, std::forward<Ts> (ds)...));
|
||||||
|
|
|
@ -72,8 +72,8 @@ struct SinglePos
|
||||||
template <typename context_t, typename ...Ts>
|
template <typename context_t, typename ...Ts>
|
||||||
typename context_t::return_t dispatch (context_t *c, Ts&&... ds) const
|
typename context_t::return_t dispatch (context_t *c, Ts&&... ds) const
|
||||||
{
|
{
|
||||||
|
if (unlikely (!c->may_dispatch (this, &u.format))) return c->no_dispatch_return_value ();
|
||||||
TRACE_DISPATCH (this, u.format);
|
TRACE_DISPATCH (this, u.format);
|
||||||
if (unlikely (!c->may_dispatch (this, &u.format))) return_trace (c->no_dispatch_return_value ());
|
|
||||||
switch (u.format) {
|
switch (u.format) {
|
||||||
case 1: return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
|
case 1: return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
|
||||||
case 2: return_trace (c->dispatch (u.format2, std::forward<Ts> (ds)...));
|
case 2: return_trace (c->dispatch (u.format2, std::forward<Ts> (ds)...));
|
||||||
|
|
|
@ -23,8 +23,8 @@ struct AlternateSubst
|
||||||
template <typename context_t, typename ...Ts>
|
template <typename context_t, typename ...Ts>
|
||||||
typename context_t::return_t dispatch (context_t *c, Ts&&... ds) const
|
typename context_t::return_t dispatch (context_t *c, Ts&&... ds) const
|
||||||
{
|
{
|
||||||
|
if (unlikely (!c->may_dispatch (this, &u.format))) return c->no_dispatch_return_value ();
|
||||||
TRACE_DISPATCH (this, u.format);
|
TRACE_DISPATCH (this, u.format);
|
||||||
if (unlikely (!c->may_dispatch (this, &u.format))) return_trace (c->no_dispatch_return_value ());
|
|
||||||
switch (u.format) {
|
switch (u.format) {
|
||||||
case 1: return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
|
case 1: return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
|
||||||
#ifndef HB_NO_BEYOND_64K
|
#ifndef HB_NO_BEYOND_64K
|
||||||
|
|
|
@ -23,8 +23,8 @@ struct LigatureSubst
|
||||||
template <typename context_t, typename ...Ts>
|
template <typename context_t, typename ...Ts>
|
||||||
typename context_t::return_t dispatch (context_t *c, Ts&&... ds) const
|
typename context_t::return_t dispatch (context_t *c, Ts&&... ds) const
|
||||||
{
|
{
|
||||||
|
if (unlikely (!c->may_dispatch (this, &u.format))) return c->no_dispatch_return_value ();
|
||||||
TRACE_DISPATCH (this, u.format);
|
TRACE_DISPATCH (this, u.format);
|
||||||
if (unlikely (!c->may_dispatch (this, &u.format))) return_trace (c->no_dispatch_return_value ());
|
|
||||||
switch (u.format) {
|
switch (u.format) {
|
||||||
case 1: return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
|
case 1: return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
|
||||||
#ifndef HB_NO_BEYOND_64K
|
#ifndef HB_NO_BEYOND_64K
|
||||||
|
|
|
@ -24,8 +24,8 @@ struct MultipleSubst
|
||||||
template <typename context_t, typename ...Ts>
|
template <typename context_t, typename ...Ts>
|
||||||
typename context_t::return_t dispatch (context_t *c, Ts&&... ds) const
|
typename context_t::return_t dispatch (context_t *c, Ts&&... ds) const
|
||||||
{
|
{
|
||||||
|
if (unlikely (!c->may_dispatch (this, &u.format))) return c->no_dispatch_return_value ();
|
||||||
TRACE_DISPATCH (this, u.format);
|
TRACE_DISPATCH (this, u.format);
|
||||||
if (unlikely (!c->may_dispatch (this, &u.format))) return_trace (c->no_dispatch_return_value ());
|
|
||||||
switch (u.format) {
|
switch (u.format) {
|
||||||
case 1: return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
|
case 1: return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
|
||||||
#ifndef HB_NO_BEYOND_64K
|
#ifndef HB_NO_BEYOND_64K
|
||||||
|
|
|
@ -20,8 +20,8 @@ struct ReverseChainSingleSubst
|
||||||
template <typename context_t, typename ...Ts>
|
template <typename context_t, typename ...Ts>
|
||||||
typename context_t::return_t dispatch (context_t *c, Ts&&... ds) const
|
typename context_t::return_t dispatch (context_t *c, Ts&&... ds) const
|
||||||
{
|
{
|
||||||
|
if (unlikely (!c->may_dispatch (this, &u.format))) return c->no_dispatch_return_value ();
|
||||||
TRACE_DISPATCH (this, u.format);
|
TRACE_DISPATCH (this, u.format);
|
||||||
if (unlikely (!c->may_dispatch (this, &u.format))) return_trace (c->no_dispatch_return_value ());
|
|
||||||
switch (u.format) {
|
switch (u.format) {
|
||||||
case 1: return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
|
case 1: return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
|
||||||
default:return_trace (c->default_return_value ());
|
default:return_trace (c->default_return_value ());
|
||||||
|
|
|
@ -27,8 +27,8 @@ struct SingleSubst
|
||||||
template <typename context_t, typename ...Ts>
|
template <typename context_t, typename ...Ts>
|
||||||
typename context_t::return_t dispatch (context_t *c, Ts&&... ds) const
|
typename context_t::return_t dispatch (context_t *c, Ts&&... ds) const
|
||||||
{
|
{
|
||||||
|
if (unlikely (!c->may_dispatch (this, &u.format))) return c->no_dispatch_return_value ();
|
||||||
TRACE_DISPATCH (this, u.format);
|
TRACE_DISPATCH (this, u.format);
|
||||||
if (unlikely (!c->may_dispatch (this, &u.format))) return_trace (c->no_dispatch_return_value ());
|
|
||||||
switch (u.format) {
|
switch (u.format) {
|
||||||
case 1: return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
|
case 1: return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
|
||||||
case 2: return_trace (c->dispatch (u.format2, std::forward<Ts> (ds)...));
|
case 2: return_trace (c->dispatch (u.format2, std::forward<Ts> (ds)...));
|
||||||
|
|
|
@ -2926,8 +2926,8 @@ struct Condition
|
||||||
template <typename context_t, typename ...Ts>
|
template <typename context_t, typename ...Ts>
|
||||||
typename context_t::return_t dispatch (context_t *c, Ts&&... ds) const
|
typename context_t::return_t dispatch (context_t *c, Ts&&... ds) const
|
||||||
{
|
{
|
||||||
|
if (unlikely (!c->may_dispatch (this, &u.format))) return c->no_dispatch_return_value ();
|
||||||
TRACE_DISPATCH (this, u.format);
|
TRACE_DISPATCH (this, u.format);
|
||||||
if (unlikely (!c->may_dispatch (this, &u.format))) return_trace (c->no_dispatch_return_value ());
|
|
||||||
switch (u.format) {
|
switch (u.format) {
|
||||||
case 1: return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
|
case 1: return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
|
||||||
default:return_trace (c->default_return_value ());
|
default:return_trace (c->default_return_value ());
|
||||||
|
|
|
@ -264,8 +264,8 @@ struct CaretValue
|
||||||
template <typename context_t, typename ...Ts>
|
template <typename context_t, typename ...Ts>
|
||||||
typename context_t::return_t dispatch (context_t *c, Ts&&... ds) const
|
typename context_t::return_t dispatch (context_t *c, Ts&&... ds) const
|
||||||
{
|
{
|
||||||
|
if (unlikely (!c->may_dispatch (this, &u.format))) return c->no_dispatch_return_value ();
|
||||||
TRACE_DISPATCH (this, u.format);
|
TRACE_DISPATCH (this, u.format);
|
||||||
if (unlikely (!c->may_dispatch (this, &u.format))) return_trace (c->no_dispatch_return_value ());
|
|
||||||
switch (u.format) {
|
switch (u.format) {
|
||||||
case 1: return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
|
case 1: return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
|
||||||
case 2: return_trace (c->dispatch (u.format2, std::forward<Ts> (ds)...));
|
case 2: return_trace (c->dispatch (u.format2, std::forward<Ts> (ds)...));
|
||||||
|
|
|
@ -2680,8 +2680,8 @@ struct Context
|
||||||
template <typename context_t, typename ...Ts>
|
template <typename context_t, typename ...Ts>
|
||||||
typename context_t::return_t dispatch (context_t *c, Ts&&... ds) const
|
typename context_t::return_t dispatch (context_t *c, Ts&&... ds) const
|
||||||
{
|
{
|
||||||
|
if (unlikely (!c->may_dispatch (this, &u.format))) return c->no_dispatch_return_value ();
|
||||||
TRACE_DISPATCH (this, u.format);
|
TRACE_DISPATCH (this, u.format);
|
||||||
if (unlikely (!c->may_dispatch (this, &u.format))) return_trace (c->no_dispatch_return_value ());
|
|
||||||
switch (u.format) {
|
switch (u.format) {
|
||||||
case 1: return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
|
case 1: return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
|
||||||
case 2: return_trace (c->dispatch (u.format2, std::forward<Ts> (ds)...));
|
case 2: return_trace (c->dispatch (u.format2, std::forward<Ts> (ds)...));
|
||||||
|
@ -3874,8 +3874,8 @@ struct ChainContext
|
||||||
template <typename context_t, typename ...Ts>
|
template <typename context_t, typename ...Ts>
|
||||||
typename context_t::return_t dispatch (context_t *c, Ts&&... ds) const
|
typename context_t::return_t dispatch (context_t *c, Ts&&... ds) const
|
||||||
{
|
{
|
||||||
|
if (unlikely (!c->may_dispatch (this, &u.format))) return c->no_dispatch_return_value ();
|
||||||
TRACE_DISPATCH (this, u.format);
|
TRACE_DISPATCH (this, u.format);
|
||||||
if (unlikely (!c->may_dispatch (this, &u.format))) return_trace (c->no_dispatch_return_value ());
|
|
||||||
switch (u.format) {
|
switch (u.format) {
|
||||||
case 1: return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
|
case 1: return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
|
||||||
case 2: return_trace (c->dispatch (u.format2, std::forward<Ts> (ds)...));
|
case 2: return_trace (c->dispatch (u.format2, std::forward<Ts> (ds)...));
|
||||||
|
@ -3914,8 +3914,8 @@ struct ExtensionFormat1
|
||||||
template <typename context_t, typename ...Ts>
|
template <typename context_t, typename ...Ts>
|
||||||
typename context_t::return_t dispatch (context_t *c, Ts&&... ds) const
|
typename context_t::return_t dispatch (context_t *c, Ts&&... ds) const
|
||||||
{
|
{
|
||||||
|
if (unlikely (!c->may_dispatch (this, this))) return c->no_dispatch_return_value ();
|
||||||
TRACE_DISPATCH (this, format);
|
TRACE_DISPATCH (this, format);
|
||||||
if (unlikely (!c->may_dispatch (this, this))) return_trace (c->no_dispatch_return_value ());
|
|
||||||
return_trace (get_subtable<typename T::SubTable> ().dispatch (c, get_type (), std::forward<Ts> (ds)...));
|
return_trace (get_subtable<typename T::SubTable> ().dispatch (c, get_type (), std::forward<Ts> (ds)...));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3993,8 +3993,8 @@ struct Extension
|
||||||
template <typename context_t, typename ...Ts>
|
template <typename context_t, typename ...Ts>
|
||||||
typename context_t::return_t dispatch (context_t *c, Ts&&... ds) const
|
typename context_t::return_t dispatch (context_t *c, Ts&&... ds) const
|
||||||
{
|
{
|
||||||
|
if (unlikely (!c->may_dispatch (this, &u.format))) return c->no_dispatch_return_value ();
|
||||||
TRACE_DISPATCH (this, u.format);
|
TRACE_DISPATCH (this, u.format);
|
||||||
if (unlikely (!c->may_dispatch (this, &u.format))) return_trace (c->no_dispatch_return_value ());
|
|
||||||
switch (u.format) {
|
switch (u.format) {
|
||||||
case 1: return_trace (u.format1.dispatch (c, std::forward<Ts> (ds)...));
|
case 1: return_trace (u.format1.dispatch (c, std::forward<Ts> (ds)...));
|
||||||
default:return_trace (c->default_return_value ());
|
default:return_trace (c->default_return_value ());
|
||||||
|
|
|
@ -390,8 +390,8 @@ struct AxisValue
|
||||||
template <typename context_t, typename ...Ts>
|
template <typename context_t, typename ...Ts>
|
||||||
typename context_t::return_t dispatch (context_t *c, Ts&&... ds) const
|
typename context_t::return_t dispatch (context_t *c, Ts&&... ds) const
|
||||||
{
|
{
|
||||||
|
if (unlikely (!c->may_dispatch (this, &u.format))) return c->no_dispatch_return_value ();
|
||||||
TRACE_DISPATCH (this, u.format);
|
TRACE_DISPATCH (this, u.format);
|
||||||
if (unlikely (!c->may_dispatch (this, &u.format))) return_trace (c->no_dispatch_return_value ());
|
|
||||||
switch (u.format) {
|
switch (u.format) {
|
||||||
case 1: return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
|
case 1: return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
|
||||||
case 2: return_trace (c->dispatch (u.format2, std::forward<Ts> (ds)...));
|
case 2: return_trace (c->dispatch (u.format2, std::forward<Ts> (ds)...));
|
||||||
|
|
Loading…
Reference in New Issue