Documentation ¶
Index ¶
- Constants
- Variables
- func GetBareNode(v *Value) ssa.InstructionNode
- func GetBareType(typ *Type) ssa.Type
- func TypeCompare(t1, t2 *Type) bool
- func ValueCompare(v1, v2 *Value) bool
- type AnalyzeContext
- func (g *AnalyzeContext) GetCurrentCall() *Value
- func (a *AnalyzeContext) IsExistedInCallStack(i *Value) bool
- func (a *AnalyzeContext) PopCall() *Value
- func (a *AnalyzeContext) PushCall(i *Value) error
- func (a *AnalyzeContext) TheCallShouldBeVisited(i *Value) bool
- func (a *AnalyzeContext) ThePhiShouldBeVisited(i *Value) bool
- func (a *AnalyzeContext) VisitPhi(i *Value)
- type Language
- type LanguageParser
- type Option
- type Program
- func (p *Program) GetAllSymbols() map[string]Values
- func (p *Program) GetErrors() ssa.SSAErrors
- func (p *Program) GetInstructionById(id int) ssa.Instruction
- func (p *Program) GetValueById(id int) (*Value, error)
- func (p *Program) GetValueByIdMust(id int) *Value
- func (p *Program) IsNil() bool
- func (p *Program) Ref(name string) Values
- func (p *Program) Show() *Program
- type Type
- type Value
- func (v *Value) Compare(other *Value) bool
- func (v *Value) FixUpdateValue() Values
- func (v *Value) GetBlock() *Value
- func (v *Value) GetBottomUses() Values
- func (v *Value) GetCallArgs() Values
- func (v *Value) GetCallReturns() Values
- func (v *Value) GetCalledBy() Values
- func (v *Value) GetCallee() *Value
- func (v *Value) GetConst() *ssa.Const
- func (v *Value) GetConstValue() any
- func (v *Value) GetContextValue(i string) (*Value, bool)
- func (i *Value) GetDefs() Values
- func (i *Value) GetFieldName() *Value
- func (i *Value) GetFieldValues() Values
- func (i *Value) GetFirstFieldValue() *Value
- func (v *Value) GetFunction() *Value
- func (v *Value) GetId() int
- func (i *Value) GetLatestFieldValue() *Value
- func (v *Value) GetMakeObjectFields() Values
- func (v *Value) GetOpcode() ssa.Opcode
- func (i *Value) GetOperand(index int) *Value
- func (i *Value) GetOperands() Values
- func (v *Value) GetParameter(i int) *Value
- func (v *Value) GetParameters() Values
- func (v *Value) GetParent() (*Value, bool)
- func (v *Value) GetPosition() *ssa.Range
- func (v *Value) GetReachable() *Value
- func (v *Value) GetReturn() Values
- func (v *Value) GetSelf() *Value
- func (i *Value) GetTopDefs() Values
- func (v *Value) GetType() *Type
- func (v *Value) GetTypeKind() ssa.TypeKind
- func (i *Value) GetUser(index int) *Value
- func (i *Value) GetUsers() Values
- func (i *Value) HasOperands() bool
- func (i *Value) HasUsers() bool
- func (v *Value) InMainFunction() bool
- func (v *Value) IsAssert() bool
- func (v *Value) IsBasicBlock() bool
- func (v *Value) IsBinOp() bool
- func (v *Value) IsCall() bool
- func (v *Value) IsCalled() bool
- func (v *Value) IsConstInst() bool
- func (v *Value) IsErrorHandler() bool
- func (v *Value) IsExtern() bool
- func (v *Value) IsField() bool
- func (v *Value) IsFunction() bool
- func (v *Value) IsIf() bool
- func (v *Value) IsJump() bool
- func (v *Value) IsLoop() bool
- func (v *Value) IsMake() bool
- func (v *Value) IsModifySelf() bool
- func (v *Value) IsNext() bool
- func (v *Value) IsPanic() bool
- func (v *Value) IsParameter() bool
- func (v *Value) IsPhi() bool
- func (v *Value) IsReachable() int
- func (v *Value) IsRecover() bool
- func (v *Value) IsReturn() bool
- func (v *Value) IsSwitch() bool
- func (v *Value) IsTypeCast() bool
- func (v *Value) IsTypeValue() bool
- func (v *Value) IsUnOp() bool
- func (v *Value) IsUndefined() bool
- func (v *Value) IsUpdate() bool
- func (v *Value) NewError(tag, msg string)
- func (v *Value) NewWarn(tag, msg string)
- func (v *Value) SetContextValue(i string, values *Value) *Value
- func (v *Value) SetParent(value *Value) *Value
- func (i *Value) Show()
- func (v *Value) ShowUseDefChain()
- func (i *Value) ShowWithSource()
- func (v *Value) String() string
- func (i *Value) StringWithSource() string
- type Values
- func (v Values) Filter(f func(*Value) bool) Values
- func (v Values) Flat(f func(*Value) Values) Values
- func (v Values) ForEach(f func(*Value)) Values
- func (v Values) Get(i int) *Value
- func (v Values) GetDefs() Values
- func (v Values) GetTopDefs() Values
- func (v Values) GetUsers() Values
- func (value Values) Ref(name string) Values
- func (v Values) Show(b ...bool) Values
- func (v Values) ShowWithSource(b ...bool) Values
- func (v Values) String() string
- func (v Values) StringEx(flag int) string
- func (v Values) Walk(handler func(i *Value)) Values
- func (v Values) WalkDefs(handler func(i *Value)) Values
Constants ¶
View Source
const ( SSA_BOTTOM_USES_targetActualParam = "targetActualParam" SSA_BOTTOM_USES_targetActualParamIndex = "targetActualParam_Index" )
Variables ¶
View Source
var ( Number = NewType(ssa.BasicTypes[ssa.Number]) String = NewType(ssa.BasicTypes[ssa.String]) Bytes = NewType(ssa.BasicTypes[ssa.Bytes]) Boolean = NewType(ssa.BasicTypes[ssa.Boolean]) UndefinedType = NewType(ssa.BasicTypes[ssa.UndefinedType]) Null = NewType(ssa.BasicTypes[ssa.Null]) Any = NewType(ssa.BasicTypes[ssa.Any]) ErrorType = NewType(ssa.BasicTypes[ssa.ErrorType]) )
View Source
var Exports = map[string]any{ "Parse": Parse, "withLanguage": WithLanguage, "withExternLib": WithExternLib, "withExternValue": WithExternValue, "Javascript": JS, "Yak": Yak, }
View Source
var ( LanguageParsers = map[Language]LanguageParser{ Yak: yak2ssa.NewParser(), JS: js2ssa.NewParser(), } )
Functions ¶
func GetBareNode ¶ added in v1.2.9
func GetBareNode(v *Value) ssa.InstructionNode
func GetBareType ¶ added in v1.2.9
func TypeCompare ¶ added in v1.2.9
func ValueCompare ¶ added in v1.2.9
Types ¶
type AnalyzeContext ¶ added in v1.3.0
type AnalyzeContext struct {
// contains filtered or unexported fields
}
func NewAnalyzeContext ¶ added in v1.3.0
func NewAnalyzeContext() *AnalyzeContext
func (*AnalyzeContext) GetCurrentCall ¶ added in v1.3.0
func (g *AnalyzeContext) GetCurrentCall() *Value
func (*AnalyzeContext) IsExistedInCallStack ¶ added in v1.3.0
func (a *AnalyzeContext) IsExistedInCallStack(i *Value) bool
func (*AnalyzeContext) PopCall ¶ added in v1.3.0
func (a *AnalyzeContext) PopCall() *Value
func (*AnalyzeContext) PushCall ¶ added in v1.3.0
func (a *AnalyzeContext) PushCall(i *Value) error
func (*AnalyzeContext) TheCallShouldBeVisited ¶ added in v1.3.0
func (a *AnalyzeContext) TheCallShouldBeVisited(i *Value) bool
func (*AnalyzeContext) ThePhiShouldBeVisited ¶ added in v1.3.0
func (a *AnalyzeContext) ThePhiShouldBeVisited(i *Value) bool
ThePhiShouldBeVisited is used to check whether the phi should be visited
func (*AnalyzeContext) VisitPhi ¶ added in v1.3.0
func (a *AnalyzeContext) VisitPhi(i *Value)
type LanguageParser ¶ added in v1.3.0
type Option ¶
type Option func(*config)
func WithExternInfo ¶ added in v1.3.0
func WithExternMethod ¶ added in v1.2.9
func WithExternMethod(b ssa.MethodBuilder) Option
func WithExternValue ¶
func WithIgnoreSyntaxError ¶ added in v1.3.0
func WithLanguage ¶
type Program ¶
func NewProgram ¶
func (*Program) GetAllSymbols ¶ added in v1.3.0
func (*Program) GetInstructionById ¶ added in v1.3.0
func (p *Program) GetInstructionById(id int) ssa.Instruction
func (*Program) GetValueById ¶ added in v1.3.0
func (*Program) GetValueByIdMust ¶ added in v1.3.0
type Value ¶
type Value struct {
// contains filtered or unexported fields
}
func NewValue ¶
func NewValue(n ssa.InstructionNode) *Value
func (*Value) FixUpdateValue ¶ added in v1.2.9
func (*Value) GetBottomUses ¶ added in v1.3.0
func (*Value) GetCallArgs ¶ added in v1.3.0
func (*Value) GetCallReturns ¶ added in v1.3.0
func (*Value) GetCalledBy ¶ added in v1.3.0
GetCalledBy desc all of 'Users' is Call or Make
func (*Value) GetConstValue ¶ added in v1.2.9
for const instruction
func (*Value) GetContextValue ¶ added in v1.3.0
GetContextValue can handle context
func (*Value) GetFieldName ¶ added in v1.3.0
func (*Value) GetFieldValues ¶ added in v1.3.0
func (*Value) GetFirstFieldValue ¶ added in v1.3.0
func (*Value) GetFunction ¶
func (*Value) GetLatestFieldValue ¶ added in v1.3.0
func (*Value) GetMakeObjectFields ¶ added in v1.3.0
func (*Value) GetOperand ¶
func (*Value) GetOperands ¶
func (*Value) GetParameter ¶
func (*Value) GetParameters ¶ added in v1.2.9
func (*Value) GetPosition ¶ added in v1.2.9
func (*Value) GetReachable ¶
func (*Value) GetTopDefs ¶ added in v1.3.0
GetTopDefs desc all of 'Defs' is not used by any other value
func (*Value) GetTypeKind ¶ added in v1.2.9
func (*Value) HasOperands ¶
func (*Value) InMainFunction ¶
func (*Value) IsBasicBlock ¶
func (*Value) IsConstInst ¶
func (*Value) IsErrorHandler ¶
func (*Value) IsFunction ¶
func (*Value) IsModifySelf ¶ added in v1.2.9
func (*Value) IsParameter ¶ added in v1.2.9
func (*Value) IsReachable ¶
if condition is true : 1 reach if condition is false : -1 unreachable if condition need calc: 0 unknown
func (*Value) IsTypeCast ¶
func (*Value) IsTypeValue ¶
func (*Value) IsUndefined ¶
func (*Value) SetContextValue ¶ added in v1.3.0
func (*Value) ShowUseDefChain ¶
func (v *Value) ShowUseDefChain()
func (*Value) ShowWithSource ¶
func (i *Value) ShowWithSource()
func (*Value) StringWithSource ¶
type Values ¶
type Values []*Value
func (Values) GetTopDefs ¶ added in v1.3.0
func (Values) ShowWithSource ¶
Click to show internal directories.
Click to hide internal directories.