Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F173671917
D27058.id79079.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D27058.id79079.diff
View Options
Index: contrib/elftoolchain/libelftc/_libelftc.h
===================================================================
--- contrib/elftoolchain/libelftc/_libelftc.h
+++ contrib/elftoolchain/libelftc/_libelftc.h
@@ -56,6 +56,7 @@
};
#define BUFFER_GROWFACTOR 1.618
+#define BUFFER_GROW(x) (((x)+0.5)*BUFFER_GROWFACTOR)
#define ELFTC_FAILURE 0
#define ELFTC_ISDIGIT(C) (isdigit((C) & 0xFF))
Index: contrib/elftoolchain/libelftc/libelftc_dem_gnu3.c
===================================================================
--- contrib/elftoolchain/libelftc/libelftc_dem_gnu3.c
+++ contrib/elftoolchain/libelftc/libelftc_dem_gnu3.c
@@ -2135,10 +2135,10 @@
if (err == 0)
return (0);
- assert(ddata->output.size > 0);
+ assert(ddata->cur_output->size > 0);
if (vector_read_cmd_find(&ddata->cmd, READ_TMPL) == NULL)
ddata->last_sname =
- ddata->output.container[ddata->output.size - 1];
+ ddata->cur_output->container[ddata->output.size - 1];
ddata->cur += len;
@@ -2421,7 +2421,7 @@
return (0);
limit = 0;
- v = &ddata->output;
+ v = ddata->cur_output;
for (;;) {
idx = v->size;
if (!cpp_demangle_read_tmpl_arg(ddata))
@@ -3909,7 +3909,7 @@
return (0);
if (v->size == v->capacity) {
- tmp_cap = v->capacity * BUFFER_GROWFACTOR;
+ tmp_cap = BUFFER_GROW(v->capacity);
if ((tmp_r_ctn = malloc(sizeof(*tmp_r_ctn) * tmp_cap)) == NULL)
return (0);
for (i = 0; i < v->size; ++i)
@@ -3974,7 +3974,7 @@
return (0);
if (v->size == v->capacity) {
- tmp_cap = v->capacity * BUFFER_GROWFACTOR;
+ tmp_cap = BUFFER_GROW(v->capacity);
if ((tmp_ctn = malloc(sizeof(enum type_qualifier) * tmp_cap))
== NULL)
return (0);
Index: contrib/elftoolchain/libelftc/libelftc_vstr.c
===================================================================
--- contrib/elftoolchain/libelftc/libelftc_vstr.c
+++ contrib/elftoolchain/libelftc/libelftc_vstr.c
@@ -152,7 +152,7 @@
assert(v->capacity > 0);
- tmp_cap = v->capacity * BUFFER_GROWFACTOR;
+ tmp_cap = BUFFER_GROW(v->capacity);
assert(tmp_cap > v->capacity);
@@ -253,7 +253,7 @@
if (dst == NULL || org == NULL)
return (false);
- tmp_cap = (dst->size + org->size) * BUFFER_GROWFACTOR;
+ tmp_cap = BUFFER_GROW(dst->size + org->size);
if ((tmp_ctn = malloc(sizeof(char *) * tmp_cap)) == NULL)
return (false);
@@ -293,7 +293,7 @@
if (dst == NULL || org == NULL)
return (false);
- tmp_cap = (dst->size + org->size) * BUFFER_GROWFACTOR;
+ tmp_cap = BUFFER_GROW(dst->size + org->size);
if ((tmp_ctn = malloc(sizeof(char *) * tmp_cap)) == NULL)
return (false);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Sep 28, 3:15 PM (10 h, 26 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
39814071
Default Alt Text
D27058.id79079.diff (2 KB)
Attached To
Mode
D27058: Improve libelftc's C++ demangler robustness
Attached
Detach File
Event Timeline
Log In to Comment