danielmarjamaki (Daniel Marjamäki)
User

Projects

User does not belong to any projects.

User Details

User Since
Mar 3 2015, 10:32 PM (111 w, 6 d)

Recent Activity

Today

danielmarjamaki added a comment to D30295: [analyzer] clarify undef shift result when shift count is negative or exceeds the bit width.

Ping.

Tue, Apr 25, 6:34 AM
D30489: [analyzer] catch out of bounds for VLA now requires changes to proceed.

Ping. Any comments?

Tue, Apr 25, 6:33 AM
danielmarjamaki added a comment to D31029: [analyzer] Fix logical not for pointers with different bit width.

Ping

Tue, Apr 25, 6:32 AM
danielmarjamaki added inline comments to D30691: [analyzer] Support for naive cross translational unit analysis.
Tue, Apr 25, 4:56 AM
danielmarjamaki added inline comments to D32346: [clang-tidy] New readability check for strlen argument.
Tue, Apr 25, 4:04 AM
danielmarjamaki added a comment to D32346: [clang-tidy] New readability check for strlen argument.

I am thinking about making my check more strict so it only warns in allocations. I believe the example code is much more motivating when there is allocation.

Tue, Apr 25, 3:45 AM
danielmarjamaki updated the diff for D32346: [clang-tidy] New readability check for strlen argument.

Fixed review comments. Made code examples and documentation more motivational.

Tue, Apr 25, 3:28 AM

Yesterday

danielmarjamaki added a comment to D32346: [clang-tidy] New readability check for strlen argument.

Thanks for all comments. I am working on fixing them. Updated patch will be uploaded soon.

Mon, Apr 24, 6:50 AM

Fri, Apr 21

danielmarjamaki created D32346: [clang-tidy] New readability check for strlen argument.
Fri, Apr 21, 3:45 AM

Thu, Apr 20

danielmarjamaki added a comment to D30771: [analyzer] Teach the MallocChecker about Glib API for two arguments.

you can ignore my comment ... LGTM

Thu, Apr 20, 11:50 PM
danielmarjamaki added a comment to D30771: [analyzer] Teach the MallocChecker about Glib API for two arguments.

I don't have further comments except that I would personally rewrite:

// Get the value of the size argument.
SVal TotalSize = State->getSVal(Arg1, LCtx);
if (SuffixWithN) {
  const Expr *Arg2 = CE->getArg(2);
  TotalSize = evalMulForBufferSize(C, Arg1, Arg2);
}

to:

// Get the value of the size argument.
SVal TotalSize;
if (!SuffixWithN) {
  TotalSize = State->getSVal(Arg1, LCtx);
} else {
  TotalSize = evalMulForBufferSize(C, Arg1, CE->getArg(2));
}
Thu, Apr 20, 11:06 PM
danielmarjamaki added inline comments to D30771: [analyzer] Teach the MallocChecker about Glib API for two arguments.
Thu, Apr 20, 2:20 AM

Wed, Apr 19

danielmarjamaki added inline comments to D30771: [analyzer] Teach the MallocChecker about Glib API for two arguments.
Wed, Apr 19, 11:11 PM
danielmarjamaki added a comment to D30771: [analyzer] Teach the MallocChecker about Glib API for two arguments.

I hold the view that I need to respect original developers' code, and it need a Global Patch for Capital variable, just like KDE's Use nullptr everywhere

Wed, Apr 19, 10:53 PM
danielmarjamaki requested changes to D30771: [analyzer] Teach the MallocChecker about Glib API for two arguments.
Wed, Apr 19, 7:56 AM
danielmarjamaki added a reviewer for D30771: [analyzer] Teach the MallocChecker about Glib API for two arguments: danielmarjamaki.
Wed, Apr 19, 7:32 AM
danielmarjamaki added inline comments to D30295: [analyzer] clarify undef shift result when shift count is negative or exceeds the bit width.
Wed, Apr 19, 7:23 AM
danielmarjamaki updated the diff for D30295: [analyzer] clarify undef shift result when shift count is negative or exceeds the bit width.

Fix review comments

  • renamed
  • reorder function arguments (CheckerContext last)
Wed, Apr 19, 7:19 AM
danielmarjamaki abandoned D31097: [clang-tidy] don't warn about implicit widening casts in function calls.

I believe https://reviews.llvm.org/D32164 is better

Wed, Apr 19, 6:54 AM

Tue, Apr 18

danielmarjamaki added a comment to D31097: [clang-tidy] don't warn about implicit widening casts in function calls.

Or I can do it for you if you wish.

Tue, Apr 18, 5:26 AM
danielmarjamaki added a comment to D31868: [analyzer] Check NULL pointer dereference issue for memset function.

Please click "Done" on fixed review comments.

Tue, Apr 18, 3:56 AM
danielmarjamaki added a comment to D30489: [analyzer] catch out of bounds for VLA.

I would propose that I rename and cleanup RangeConstraintManager::uglyEval() and add it. When I tested it, the Z3 does not seem to handle this.

Tue, Apr 18, 1:50 AM
danielmarjamaki added a comment to D31097: [clang-tidy] don't warn about implicit widening casts in function calls.

I would recommend that this is either fixed soon or that we commit my changes so it can be implemented more properly later. Right now users will see false positives.

Tue, Apr 18, 1:38 AM
danielmarjamaki added a comment to D31029: [analyzer] Fix logical not for pointers with different bit width.

Ping

Tue, Apr 18, 1:36 AM

Wed, Apr 12

danielmarjamaki added inline comments to D30909: [Analyzer] Finish taint propagation to derived symbols of tainted regions.
Wed, Apr 12, 4:38 AM
danielmarjamaki added a reviewer for D31868: [analyzer] Check NULL pointer dereference issue for memset function: danielmarjamaki.
Wed, Apr 12, 4:28 AM
danielmarjamaki added a comment to D31868: [analyzer] Check NULL pointer dereference issue for memset function.

Thanks! Looks like a valueable addition.

Wed, Apr 12, 4:27 AM
danielmarjamaki added inline comments to D31886: [analyzer] Simplify values in binary operations more aggressively.
Wed, Apr 12, 4:12 AM

Fri, Apr 7

danielmarjamaki updated the diff for D30489: [analyzer] catch out of bounds for VLA.

This is just work in progress!!

Fri, Apr 7, 5:07 AM

Wed, Apr 5

danielmarjamaki added a comment to D31650: [Analyzer] Detect when function pointer is freed.

sorry ... I guess that should be something like "void *p = malloc(100);"

Wed, Apr 5, 6:42 AM
danielmarjamaki added a comment to D31650: [Analyzer] Detect when function pointer is freed.
In D31650#717691, @NoQ wrote:

Is freeing function pointers always undefined?

Wed, Apr 5, 6:38 AM
danielmarjamaki committed rL299523: [analyzer] alpha.core.Conversion - Fix false positive for 'U32 += S16;'….
[analyzer] alpha.core.Conversion - Fix false positive for 'U32 += S16;'…
Wed, Apr 5, 2:09 AM
danielmarjamaki closed D25596: alpha.core.Conversion - Fix false positive for 'U32 += S16;' expression, that is not unsafe by committing rL299523: [analyzer] alpha.core.Conversion - Fix false positive for 'U32 += S16;'….
Wed, Apr 5, 2:09 AM

Mon, Apr 3

danielmarjamaki requested changes to D30691: [analyzer] Support for naive cross translational unit analysis.
Mon, Apr 3, 12:29 AM
danielmarjamaki added inline comments to D30691: [analyzer] Support for naive cross translational unit analysis.
Mon, Apr 3, 12:22 AM
danielmarjamaki added a comment to D25596: alpha.core.Conversion - Fix false positive for 'U32 += S16;' expression, that is not unsafe.

Ping

Mon, Apr 3, 12:14 AM
danielmarjamaki added a comment to D30295: [analyzer] clarify undef shift result when shift count is negative or exceeds the bit width.

Ping

Mon, Apr 3, 12:13 AM
danielmarjamaki added a comment to D31029: [analyzer] Fix logical not for pointers with different bit width.

Ping

Mon, Apr 3, 12:13 AM

Fri, Mar 31

danielmarjamaki added inline comments to D30691: [analyzer] Support for naive cross translational unit analysis.
Fri, Mar 31, 2:32 AM

Mar 23 2017

danielmarjamaki added a comment to D31029: [analyzer] Fix logical not for pointers with different bit width.

Are there other cases where makeNull would need to be replaced?

There might be. As I understand it, this is the only known case at the moment.

Mar 23 2017, 9:05 AM
danielmarjamaki updated the diff for D25596: alpha.core.Conversion - Fix false positive for 'U32 += S16;' expression, that is not unsafe.

Updated the patch so all the loss of precision are detected also

Mar 23 2017, 8:54 AM
danielmarjamaki added a comment to D31029: [analyzer] Fix logical not for pointers with different bit width.

Are there other cases where makeNull would need to be replaced?

Mar 23 2017, 2:38 AM
danielmarjamaki updated the diff for D31029: [analyzer] Fix logical not for pointers with different bit width.

Added a testcase that will crash without the fix. Used the amdgcn target as that happens to use different pointer bit widths for different address spaces.

Mar 23 2017, 2:31 AM

Mar 22 2017

danielmarjamaki updated the diff for D25596: alpha.core.Conversion - Fix false positive for 'U32 += S16;' expression, that is not unsafe.

I added more testcases. There are several undetected "TODO: loss of precision" right now in the tests that I would like to fix. If this patch to fix FP is accepted I will commit it and continue working on the TODO tests. If it's not accepted I will continue investigating the TODO tests anyway..

Mar 22 2017, 7:19 AM
danielmarjamaki added a comment to D31097: [clang-tidy] don't warn about implicit widening casts in function calls.

Well.. feel free to provide an alternative fix. If the message is more specific and it must be enabled explicitly by an option then maybe it's good enough for me.

Mar 22 2017, 6:48 AM
danielmarjamaki added a comment to D31097: [clang-tidy] don't warn about implicit widening casts in function calls.

Hi!

There is an option to disable the checking of widening casts. It is enabled by default. You can disable it any time. Or, if you find too much false positives, we can discuss about setting this option to disabled as default.

I am convinced that checking implicit widening casts are also necessary. We should probably change the error message in the implicit case from "misplaced" to "missing", and maybe also rename the checker itself. Separating it to two different checkers, which are almost copy of each other is huge code duplication.

Mar 22 2017, 6:38 AM

Mar 20 2017

danielmarjamaki added a comment to D31097: [clang-tidy] don't warn about implicit widening casts in function calls.

I believe there is pointless code in relativeIntSizes etc. If there is for instance "a+b" then the result can't be a char type.

static int relativeIntSizes(BuiltinType::Kind Kind) {
  switch (Kind) {
  case BuiltinType::UChar:
    return 1;
  case BuiltinType::SChar:
    return 1;
  case BuiltinType::Char_U:
    return 1;
  case BuiltinType::Char_S:
    return 1;
  case BuiltinType::UShort:
    return 2;
  case BuiltinType::Short:
    return 2;
  case BuiltinType::UInt:
    return 3;
  case BuiltinType::Int:
    return 3;
  case BuiltinType::ULong:
    return 4;
  case BuiltinType::Long:
    return 4;
  case BuiltinType::ULongLong:
    return 5;
  case BuiltinType::LongLong:
    return 5;
  case BuiltinType::UInt128:
    return 6;
  case BuiltinType::Int128:
    return 6;
  default:
    return 0;
  }
}
Mar 20 2017, 7:28 AM
danielmarjamaki updated the diff for D31097: [clang-tidy] don't warn about implicit widening casts in function calls.

Remove warnings for implicit casts.

Mar 20 2017, 7:09 AM
danielmarjamaki updated the diff for D30295: [analyzer] clarify undef shift result when shift count is negative or exceeds the bit width.

Fix review comment. Made isShiftOverflow() static.

Mar 20 2017, 5:46 AM
danielmarjamaki added a comment to D31097: [clang-tidy] don't warn about implicit widening casts in function calls.

I wonder whether warning on implicit casts still makes sense for example in mission critical code. So maybe it is worth to have a configuration option with the default setting being less strict and chatty. What do you think?

But it's not about "misplaced casts", it's about implicit conversions and -Wconversion diagnostic can take care of this.

Actually, the diagnostics about implicit casts here might be useful (but maybe in a separate check). I have to look again at https://reviews.llvm.org/D17987.

Mar 20 2017, 1:30 AM

Mar 17 2017

danielmarjamaki added a comment to D31097: [clang-tidy] don't warn about implicit widening casts in function calls.

In my opinion, we should stop warning about all implicit casts.

Mar 17 2017, 1:31 PM
danielmarjamaki created D31097: [clang-tidy] don't warn about implicit widening casts in function calls.
Mar 17 2017, 1:01 PM
danielmarjamaki added inline comments to D30295: [analyzer] clarify undef shift result when shift count is negative or exceeds the bit width.
Mar 17 2017, 8:34 AM
danielmarjamaki updated the diff for D30295: [analyzer] clarify undef shift result when shift count is negative or exceeds the bit width.

Fix review comments

Mar 17 2017, 8:33 AM

Mar 16 2017

danielmarjamaki added a comment to D31029: [analyzer] Fix logical not for pointers with different bit width.

I am not sure where to look. I heard somebody say OpenCL has different pointer widths.

Mar 16 2017, 8:42 AM
danielmarjamaki created D31029: [analyzer] Fix logical not for pointers with different bit width.
Mar 16 2017, 6:48 AM

Mar 15 2017

danielmarjamaki added a comment to D30295: [analyzer] clarify undef shift result when shift count is negative or exceeds the bit width.

Ping

Mar 15 2017, 1:40 AM

Mar 8 2017

danielmarjamaki committed rL297283: [analyzer] Clarify 'uninitialized function argument' messages.
[analyzer] Clarify 'uninitialized function argument' messages
Mar 8 2017, 7:34 AM
danielmarjamaki closed D30341: [analyzer] clarify error messages about uninitialized function arguments by committing rL297283: [analyzer] Clarify 'uninitialized function argument' messages.
Mar 8 2017, 7:34 AM

Mar 7 2017

danielmarjamaki committed rL297187: [analyzer] Fix crashes in CastToStruct checker for undefined structs.
[analyzer] Fix crashes in CastToStruct checker for undefined structs
Mar 7 2017, 11:32 AM
danielmarjamaki closed D28297: [StaticAnalyzer] Fix crash in CastToStructChecker by committing rL297187: [analyzer] Fix crashes in CastToStruct checker for undefined structs.
Mar 7 2017, 11:32 AM
danielmarjamaki added a comment to D30489: [analyzer] catch out of bounds for VLA.

Also, in your state dumps no information is actually lost. The fact that the value of variable sz is reg_$0<sz> is trivial: you could ask the Store what's the value of the variable sz and it'd say reg_$0<sz> if there are no bindings over it.

Mar 7 2017, 8:10 AM
danielmarjamaki added reviewers for D30295: [analyzer] clarify undef shift result when shift count is negative or exceeds the bit width: zaks.anna, a.sidorin, dcoughlin.
Mar 7 2017, 6:15 AM

Mar 6 2017

danielmarjamaki added a comment to D30341: [analyzer] clarify error messages about uninitialized function arguments.

No the argument is not shown with tilde/column number.

Mar 6 2017, 11:43 PM
danielmarjamaki added a comment to D25728: Test ExprEngine handling of unknown values.

Thanks! That sounds excellent to me.

Mar 6 2017, 11:22 PM

Mar 3 2017

danielmarjamaki updated the diff for D30341: [analyzer] clarify error messages about uninitialized function arguments.

Fix review comment

Mar 3 2017, 6:29 AM
danielmarjamaki added a comment to D30489: [analyzer] catch out of bounds for VLA.

To me it seems that the extent is calculated properly in ArrayBoundsV2.

Mar 3 2017, 3:28 AM

Mar 2 2017

danielmarjamaki added inline comments to D30341: [analyzer] clarify error messages about uninitialized function arguments.
Mar 2 2017, 4:00 PM
danielmarjamaki added inline comments to D30341: [analyzer] clarify error messages about uninitialized function arguments.
Mar 2 2017, 2:27 PM

Mar 1 2017

danielmarjamaki added a comment to D30157: [analyzer] Improve valist check.

I am running this checker right now on various projects. Here are currently seen results.. https://drive.google.com/open?id=0BykPmWrCOxt2STZMOXZ5OGlwM3c

Mar 1 2017, 1:48 AM
danielmarjamaki created D30489: [analyzer] catch out of bounds for VLA.
Mar 1 2017, 1:37 AM

Feb 28 2017

danielmarjamaki added inline comments to D30341: [analyzer] clarify error messages about uninitialized function arguments.
Feb 28 2017, 7:35 AM
danielmarjamaki updated the diff for D30341: [analyzer] clarify error messages about uninitialized function arguments.

minor updates. Use llvm::getOrdinalNumber(). Use llvm::Twine.

Feb 28 2017, 7:27 AM
danielmarjamaki committed rL296477: [Sema] Detect more array index out of bounds when C++ overloaded operators are….
[Sema] Detect more array index out of bounds when C++ overloaded operators are…
Feb 28 2017, 7:05 AM
danielmarjamaki closed D30192: [Sema] Detecting more array index out of bounds by committing rL296477: [Sema] Detect more array index out of bounds when C++ overloaded operators are….
Feb 28 2017, 7:05 AM
danielmarjamaki added reviewers for D28297: [StaticAnalyzer] Fix crash in CastToStructChecker: xazax.hun, dcoughlin, zaks.anna, a.sidorin.
Feb 28 2017, 4:14 AM

Feb 27 2017

danielmarjamaki committed rL296326: [analyzer] clarify 'result is garbage value' when it is out of bounds.
[analyzer] clarify 'result is garbage value' when it is out of bounds
Feb 27 2017, 2:56 AM
danielmarjamaki closed D28278: [StaticAnalyzer] dont show wrong 'garbage value' warning when there is array index out of bounds by committing rL296326: [analyzer] clarify 'result is garbage value' when it is out of bounds.
Feb 27 2017, 2:56 AM

Feb 24 2017

danielmarjamaki added a reviewer for D30192: [Sema] Detecting more array index out of bounds: aaron.ballman.
Feb 24 2017, 8:58 AM
danielmarjamaki created D30341: [analyzer] clarify error messages about uninitialized function arguments.
Feb 24 2017, 8:45 AM
danielmarjamaki updated the diff for D28278: [StaticAnalyzer] dont show wrong 'garbage value' warning when there is array index out of bounds.

Fixed review comment. Broke out function.

Feb 24 2017, 3:40 AM
danielmarjamaki added inline comments to D30157: [analyzer] Improve valist check.
Feb 24 2017, 3:26 AM
danielmarjamaki committed rL296100: [clang-tidy] Fix readability-redundant-declaration false positive.
[clang-tidy] Fix readability-redundant-declaration false positive
Feb 24 2017, 1:14 AM
danielmarjamaki closed D27048: readability-redundant-declaration: fix false positive for static member declaration by committing rL296100: [clang-tidy] Fix readability-redundant-declaration false positive.
Feb 24 2017, 1:14 AM

Feb 23 2017

danielmarjamaki updated the diff for D28278: [StaticAnalyzer] dont show wrong 'garbage value' warning when there is array index out of bounds.

Making the error message more precise.

Feb 23 2017, 11:45 AM
danielmarjamaki abandoned D24861: [Sema] extend Wshift-op-parentheses so it warns for multiplicative operators.

I will not work on this in the near future

Feb 23 2017, 11:17 AM
danielmarjamaki requested review of D28297: [StaticAnalyzer] Fix crash in CastToStructChecker.

I have updated the patch and want a new review.

Feb 23 2017, 7:49 AM
danielmarjamaki updated the diff for D28297: [StaticAnalyzer] Fix crash in CastToStructChecker.

It was reported in the bugzilla report that my first fix did not fix all crashes. A new example code was provided that triggered a new crash. I have updated the patch so both crashes are fixed.

Feb 23 2017, 7:48 AM
danielmarjamaki added a comment to D27048: readability-redundant-declaration: fix false positive for static member declaration.

Ping

Feb 23 2017, 6:43 AM
danielmarjamaki created D30295: [analyzer] clarify undef shift result when shift count is negative or exceeds the bit width.
Feb 23 2017, 4:53 AM
danielmarjamaki added a comment to D28278: [StaticAnalyzer] dont show wrong 'garbage value' warning when there is array index out of bounds.

Does the code you added detects array out of bounds cases without false positives? Is it an option to just have this checkers produce a more precise error message in the specific case.

A lot of work will probably need to be done to implement a proper array out of bounds checking and no-one is working on that.

Feb 23 2017, 2:35 AM

Feb 21 2017

danielmarjamaki reopened D28297: [StaticAnalyzer] Fix crash in CastToStructChecker.

I reverted the change because there were buildbot failures.

Feb 21 2017, 3:40 AM
danielmarjamaki created D30192: [Sema] Detecting more array index out of bounds.
Feb 21 2017, 3:12 AM

Feb 18 2017

danielmarjamaki committed rL295548: [analyzer] Revert 295545. There are buildbot failures..
[analyzer] Revert 295545. There are buildbot failures.
Feb 18 2017, 8:43 AM
danielmarjamaki added a reverting commit for rL295545: [analyzer] Fix crash in CastToStruct when there is no record definition: rL295548: [analyzer] Revert 295545. There are buildbot failures..
Feb 18 2017, 8:43 AM
danielmarjamaki committed rL295545: [analyzer] Fix crash in CastToStruct when there is no record definition.
[analyzer] Fix crash in CastToStruct when there is no record definition
Feb 18 2017, 3:30 AM
danielmarjamaki closed D28297: [StaticAnalyzer] Fix crash in CastToStructChecker by committing rL295545: [analyzer] Fix crash in CastToStruct when there is no record definition.
Feb 18 2017, 3:30 AM

Feb 15 2017

danielmarjamaki updated the diff for D27048: readability-redundant-declaration: fix false positive for static member declaration.

Fix review comment about CHECK-FIXES regexp pattern.

Feb 15 2017, 9:48 AM
danielmarjamaki added a comment to D28297: [StaticAnalyzer] Fix crash in CastToStructChecker.
In D28297#642523, @NoQ wrote:

Looks good. I assume the crash is in getTypeInfo(); do you have any idea what are exact prerequisites for using this method? So that there were no more crashes here.

Feb 15 2017, 3:41 AM
danielmarjamaki added a comment to D28278: [StaticAnalyzer] dont show wrong 'garbage value' warning when there is array index out of bounds.

I am not against that the error is shown as long as it's not misleading/wrong. To avoid misleading, in my humble opinion the error message should say "array index out of bounds".

Feb 15 2017, 2:55 AM