Add missing case to block instruction converter

Reviewed By: jvillard

Differential Revision: D8951773

fbshipit-source-id: ce0d1f08c
master
Martin Trojer 6 years ago committed by Facebook Github Bot
parent 83a4a8fa5b
commit ee7f07a1a9

@ -728,6 +728,9 @@ let specialize_with_block_args_instrs resolved_pdesc substitutions =
| Exp.Lvar origin_pvar ->
let new_pvar = convert_pvar origin_pvar in
Exp.Lvar new_pvar
| Exp.Lfield (Exp.Lvar origin_pvar, fname, typ) ->
let new_pvar = convert_pvar origin_pvar in
Exp.Lfield (Exp.Lvar new_pvar, fname, typ)
| _ ->
exp
in

@ -0,0 +1,29 @@
/*
* Copyright (c) 2018-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#import <Foundation/NSString.h>
typedef struct {
const char* name;
} name_t;
static void CFunWithBlockOk(void (^cb)(void)) {
name_t const* ns = NULL;
name_t n = ns[0]; // Lfield accessor (needs to be specialized correctly)
if (n.name != nil && cb != NULL)
cb();
}
@interface A : NSObject
- (void)mOk;
@end
@implementation A
- (void)mOk {
CFunWithBlockOk(^(void){
});
}
@end

@ -1,2 +1,4 @@
codetoanalyze/objcpp/errors/BlockLfield.mm, A_mOk, 1, PRECONDITION_NOT_FOUND, no_bucket, ERROR, [start of procedure mOk]
codetoanalyze/objcpp/errors/BlockLfield.mm, CFunWithBlockOk, 2, PRECONDITION_NOT_MET, no_bucket, WARNING, [start of procedure CFunWithBlockOk()]
codetoanalyze/objcpp/errors/c_functions.mm, main, 4, NULL_DEREFERENCE, B5, ERROR, [start of procedure main(),start of procedure autoUpdating,return from a call to A_autoUpdating,start of procedure autoUpdating2,Skipping dispatch_once2(): method has no implementation,return from a call to A_autoUpdating2,Executing synthesized getter block,start of procedure block,return from a call to objc_blockobjc_blockA_autoUpdating_1_2,Message block with receiver nil returns nil.]
codetoanalyze/objcpp/errors/retain_cycles/RetainCycleWithStruct.mm, Animation_tracer, 2, RETAIN_CYCLE, no_bucket, ERROR, [start of procedure tracer,start of procedure _State,return from a call to _State__State,start of procedure initWithAnimation:,Taking true branch,return from a call to Tracer_initWithAnimation:]

Loading…
Cancel
Save