Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 716520 | Differences between
and this patch

Collapse All | Expand All

(-)a/lib/zstd/decompress.c (+2 lines)
Lines 2490-2495 size_t ZSTD_decompressStream(ZSTD_DStream *zds, ZSTD_outBuffer *output, ZSTD_inB Link Here
2490
	}
2490
	}
2491
}
2491
}
2492
2492
2493
#ifndef ZSTD_PREBOOT
2493
EXPORT_SYMBOL(ZSTD_DCtxWorkspaceBound);
2494
EXPORT_SYMBOL(ZSTD_DCtxWorkspaceBound);
2494
EXPORT_SYMBOL(ZSTD_initDCtx);
2495
EXPORT_SYMBOL(ZSTD_initDCtx);
2495
EXPORT_SYMBOL(ZSTD_decompressDCtx);
2496
EXPORT_SYMBOL(ZSTD_decompressDCtx);
Lines 2529-2531 EXPORT_SYMBOL(ZSTD_insertBlock); Link Here
2529
2530
2530
MODULE_LICENSE("Dual BSD/GPL");
2531
MODULE_LICENSE("Dual BSD/GPL");
2531
MODULE_DESCRIPTION("Zstd Decompressor");
2532
MODULE_DESCRIPTION("Zstd Decompressor");
2533
#endif
(-)a/lib/zstd/fse_decompress.c (-8 / +1 lines)
Lines 47-52 Link Here
47
****************************************************************/
47
****************************************************************/
48
#include "bitstream.h"
48
#include "bitstream.h"
49
#include "fse.h"
49
#include "fse.h"
50
#include "zstd_internal.h"
50
#include <linux/compiler.h>
51
#include <linux/compiler.h>
51
#include <linux/kernel.h>
52
#include <linux/kernel.h>
52
#include <linux/string.h> /* memcpy, memset */
53
#include <linux/string.h> /* memcpy, memset */
Lines 60-73 Link Here
60
		enum { FSE_static_assert = 1 / (int)(!!(c)) }; \
61
		enum { FSE_static_assert = 1 / (int)(!!(c)) }; \
61
	} /* use only *after* variable declarations */
62
	} /* use only *after* variable declarations */
62
63
63
/* check and forward error code */
64
#define CHECK_F(f)                  \
65
	{                           \
66
		size_t const e = f; \
67
		if (FSE_isError(e)) \
68
			return e;   \
69
	}
70
71
/* **************************************************************
64
/* **************************************************************
72
*  Templates
65
*  Templates
73
****************************************************************/
66
****************************************************************/
(-)a/lib/zstd/zstd_internal.h (-2 / +12 lines)
Lines 127-133 static const U32 OF_defaultNormLog = OF_DEFAULTNORMLOG; Link Here
127
*  Shared functions to include for inlining
127
*  Shared functions to include for inlining
128
*********************************************/
128
*********************************************/
129
ZSTD_STATIC void ZSTD_copy8(void *dst, const void *src) {
129
ZSTD_STATIC void ZSTD_copy8(void *dst, const void *src) {
130
	memcpy(dst, src, 8);
130
	/*
131
	 * zstd relies heavily on gcc being able to analyze and inline this
132
	 * memcpy() call, since it is called in a tight loop. Preboot mode
133
	 * is compiled in freestanding mode, which stops gcc from analyzing
134
	 * memcpy(). Use __builtin_memcpy() to tell gcc to analyze this as a
135
	 * regular memcpy().
136
	 */
137
	__builtin_memcpy(dst, src, 8);
131
}
138
}
132
/*! ZSTD_wildcopy() :
139
/*! ZSTD_wildcopy() :
133
*   custom version of memcpy(), can copy up to 7 bytes too many (8 bytes if length==0) */
140
*   custom version of memcpy(), can copy up to 7 bytes too many (8 bytes if length==0) */
Lines 137-149 ZSTD_STATIC void ZSTD_wildcopy(void *dst, const void *src, ptrdiff_t length) Link Here
137
	const BYTE* ip = (const BYTE*)src;
144
	const BYTE* ip = (const BYTE*)src;
138
	BYTE* op = (BYTE*)dst;
145
	BYTE* op = (BYTE*)dst;
139
	BYTE* const oend = op + length;
146
	BYTE* const oend = op + length;
140
	/* Work around https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81388.
147
#if defined(GCC_VERSION) && GCC_VERSION >= 70000 && GCC_VERSION < 70200
148
	/*
149
	 * Work around https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81388.
141
	 * Avoid the bad case where the loop only runs once by handling the
150
	 * Avoid the bad case where the loop only runs once by handling the
142
	 * special case separately. This doesn't trigger the bug because it
151
	 * special case separately. This doesn't trigger the bug because it
143
	 * doesn't involve pointer/integer overflow.
152
	 * doesn't involve pointer/integer overflow.
144
	 */
153
	 */
145
	if (length <= 8)
154
	if (length <= 8)
146
		return ZSTD_copy8(dst, src);
155
		return ZSTD_copy8(dst, src);
156
#endif
147
	do {
157
	do {
148
		ZSTD_copy8(op, ip);
158
		ZSTD_copy8(op, ip);
149
		op += 8;
159
		op += 8;

Return to bug 716520