aboutsummaryrefslogtreecommitdiff
path: root/src/rt
diff options
context:
space:
mode:
authorPatrick Walton <[email protected]>2010-10-11 17:11:59 -0700
committerPatrick Walton <[email protected]>2010-10-11 17:11:59 -0700
commit5177898db10de8903b28a45fa0452b4ba8dfaf36 (patch)
treed89497eef4f672dd05a2af488d4f496f815f6d7f /src/rt
parentTry to print backtraces on failure (diff)
downloadrust-5177898db10de8903b28a45fa0452b4ba8dfaf36.tar.xz
rust-5177898db10de8903b28a45fa0452b4ba8dfaf36.zip
Use new and delete instead of alloca(). Should put out the burning tinderbox.
Diffstat (limited to 'src/rt')
-rw-r--r--src/rt/rust_log.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/rt/rust_log.cpp b/src/rt/rust_log.cpp
index 74a5d00e..20f3f146 100644
--- a/src/rt/rust_log.cpp
+++ b/src/rt/rust_log.cpp
@@ -8,14 +8,13 @@
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
-#include <alloca.h>
static uint32_t
read_type_bit_mask() {
uint32_t bits = rust_log::ULOG | rust_log::ERR;
char *env_str = getenv("RUST_LOG");
if (env_str) {
- char *str = (char *)alloca(strlen(env_str) + 2);
+ char *str = new char[strlen(env_str) + 2];
str[0] = ',';
strcpy(str + 1, env_str);
@@ -38,6 +37,8 @@ read_type_bit_mask() {
bits |= strstr(str, ",bt") ? rust_log::BT : 0;
bits |= strstr(str, ",all") ? rust_log::ALL : 0;
bits = strstr(str, ",none") ? 0 : bits;
+
+ delete[] str;
}
return bits;
}