Skip to content

Commit fcdd667

Browse files
committed
Fix a few issues found by code analysis
1 parent 76b7189 commit fcdd667

File tree

5 files changed

+10
-12
lines changed

5 files changed

+10
-12
lines changed

src/ast_callables.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,8 @@ namespace Sass {
124124
Callable(SourceSpan::internal("[EXTERNAL]")),
125125
envkey_(fname),
126126
declaration_(parameters),
127-
lambda_(lambda)
127+
lambda_(lambda),
128+
cookie_(nullptr)
128129
{}
129130

130131
// Equality comparator (needed for `get-function` value)

src/ast_imports.hpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,7 @@ namespace Sass {
5454
// They also don't allow any supports or media queries.
5555
class IncludeImport final : public ImportBase, public ModRule
5656
{
57-
private:
58-
ADD_PROPERTY(bool, wasExported33);
5957
public:
60-
61-
const sass::vector<ResolvedImport>* candidates22 = nullptr;
62-
6358
IncludeImport(const SourceSpan& pstate,
6459
const sass::string& prev,
6560
const sass::string& url,

src/ast_nodes.hpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,13 +196,15 @@ namespace Sass {
196196
public:
197197

198198
// Value copy constructor
199-
Statement(const SourceSpan& pstate)
200-
: AstNode(pstate)
199+
Statement(const SourceSpan& pstate) :
200+
AstNode(pstate),
201+
tabs_(0)
201202
{}
202203

203204
// Value move constructor
204-
Statement(SourceSpan&& pstate)
205-
: AstNode(std::move(pstate))
205+
Statement(SourceSpan&& pstate) :
206+
AstNode(std::move(pstate)),
207+
tabs_(0)
206208
{}
207209

208210
// Copy constructor

src/parser_stylesheet.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ namespace Sass {
304304
if (isIndented() && styles->empty()) {
305305
compiler.addWarning(
306306
"This selector doesn't have any properties and won't be rendered.",
307-
itpl->pstate());
307+
itpl ? itpl->pstate() : SourceSpan{});
308308
}
309309

310310
return styles.detach();

src/source_map.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ namespace Sass {
9696
{
9797
if (out.srcmap) {
9898
Offset size(out.srcmap->position);
99-
for (Mapping mapping : out.srcmap->mappings) {
99+
for (const Mapping& mapping : out.srcmap->mappings) {
100100
if (mapping.target.line > size.line) {
101101
throw(std::runtime_error("prepend sourcemap has illegal line"));
102102
}

0 commit comments

Comments
 (0)