diff --git a/src/llnode.cc b/src/llnode.cc index fd4b068d..f69aa09a 100644 --- a/src/llnode.cc +++ b/src/llnode.cc @@ -477,8 +477,7 @@ bool PluginInitialize(SBDebugger d) { setPropertyCmd.AddCommand("color", new llnode::SetPropertyColorCmd(), "Set color property value"); - setPropertyCmd.AddCommand("tree-padding", - new llnode::SetTreePaddingCmd(&llv8), + setPropertyCmd.AddCommand("tree-padding", new llnode::SetTreePaddingCmd(), "Set tree-padding value"); interpreter.AddCommand("findjsobjects", new llnode::FindObjectsCmd(&llscan), diff --git a/src/llnode.h b/src/llnode.h index 2e6deb7f..5a02425f 100644 --- a/src/llnode.h +++ b/src/llnode.h @@ -32,14 +32,10 @@ class SetPropertyColorCmd : public CommandBase { class SetTreePaddingCmd : public CommandBase { public: - SetTreePaddingCmd(v8::LLV8* llv8) : llv8_(llv8) {} ~SetTreePaddingCmd() override {} bool DoExecute(lldb::SBDebugger d, char** cmd, lldb::SBCommandReturnObject& result) override; - - private: - v8::LLV8* llv8_; }; class PrintCmd : public CommandBase { diff --git a/src/llscan.cc b/src/llscan.cc index ec9431a7..b92f3fc2 100644 --- a/src/llscan.cc +++ b/src/llscan.cc @@ -647,7 +647,7 @@ void FindReferencesCmd::PrintRecursiveReferences( std::stringstream seen_str; seen_str << rang::fg::red << " [seen above]" << rang::fg::reset << std::endl; - result.Printf(seen_str.str().c_str()); + result.Printf("%s", seen_str.str().c_str()); } else { visited_references->push_back(address); v8::Value value(llscan_->v8(), address); diff --git a/src/llv8.cc b/src/llv8.cc index 014d407b..1f4afa81 100644 --- a/src/llv8.cc +++ b/src/llv8.cc @@ -111,7 +111,11 @@ double LLV8::LoadDouble(int64_t addr, Error& err) { } err = Error::Ok(); - return *reinterpret_cast(&value); + // dereferencing type-punned pointer will break strict-aliasing rules + // return *reinterpret_cast(&value); + double dvalue; + std::memcpy(&dvalue, &value, sizeof(double)); + return dvalue; } @@ -1288,8 +1292,8 @@ StackTrace::StackTrace(JSArray frame_array, Error& err) if ((len_ != 0) || ((frame_array_.GetArrayLength(err) - 1) % multiplier_ != 0)) { Error::PrintInDebugMode( - "JSArray doesn't look like a Stack Frames array. stack_len: %lld " - "array_len: %lld", + "JSArray doesn't look like a Stack Frames array. stack_len: %d " + "array_len: %ld", len_, frame_array_.GetArrayLength(err)); len_ = -1; multiplier_ = -1;