Displaying 18 results from an estimated 18 matches for "bufferstart".
2016 Nov 17
3
UB in MemoryBufferMMapFile
...lib/Support/MemoryBuffer.cpp:45:
> void MemoryBuffer::init(const char *BufStart, const char *BufEnd,
> bool RequiresNullTerminator) {
> assert((!RequiresNullTerminator || BufEnd[0] == 0) &&
> "Buffer is not null terminated!");
> BufferStart = BufStart;
> BufferEnd = BufEnd;
> }
However, this can be, and often is, one past an allocated region, since
in MemoryBufferMMapFile we mmap `Len` bytes and then call this with
`BufEnd = Start + Len`:
from lib/Support/MemoryBuffer.cpp:210:
> MemoryBufferMMapFile(bool RequiresNullTer...
2012 May 18
0
[LLVMdev] [RFC] llvm/include/Support/FileOutputBuffer.h
...size_t size,
> + OwningPtr<FileOutputBuffer> &result,
> + unsigned flags=0);
Arguments should start with an upper case letter. (same for all of these)
> + /// Returns a pointer to the start of the buffer.
> + uint8_t *getBufferStart() const {
> + return bufferStart;
> + }
> +
> + /// Returns a pointer to the end of the buffer.
> + uint8_t *getBufferEnd() const {
> + return bufferEnd;
> + }
> +
> + /// Returns size of the buffer.
> + size_t getBufferSize() const {
> + return buffe...
2012 May 08
3
[LLVMdev] [RFC] llvm/include/Support/OutputBuffer.h
...the specified path.
>> static error_code createFile(StringRef filePath, Flags flags, size_t
>> size,
>> OwningPtr<OutputBuffer> &result);
>>
>>
>> /// Returns a pointer to the start of the buffer.
>> uint8_t *bufferStart();
>>
>> /// Returns a pointer to the end of the buffer.
>> uint8_t *bufferEnd();
>>
>> /// Returns size of the buffer.
>> size_t size();
>>
>> /// Flushes the content of the buffer to its file and deallocates the
>> /// buffer....
2012 May 17
3
[LLVMdev] [RFC] llvm/include/Support/FileOutputBuffer.h
I now have an implementation of FileOutputBuffer (OutputBuffer was already taken). The patch supports the functionality listed below and I've tested that it works for lld.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: FileOutputBuffer.patch
Type: application/octet-stream
Size: 25308 bytes
Desc: not available
URL:
2012 May 07
4
[LLVMdev] [RFC] llvm/include/Support/OutputBuffer.h
...ommitted, the buffer will be written
/// to the file at the specified path.
static error_code createFile(StringRef filePath, Flags flags, size_t size,
OwningPtr<OutputBuffer> &result);
/// Returns a pointer to the start of the buffer.
uint8_t *bufferStart();
/// Returns a pointer to the end of the buffer.
uint8_t *bufferEnd();
/// Returns size of the buffer.
size_t size();
/// Flushes the content of the buffer to its file and deallocates the
/// buffer. If commit() is not called before this object's destructor
/// is c...
2012 May 08
0
[LLVMdev] [RFC] llvm/include/Support/OutputBuffer.h
...>> static error_code createFile(StringRef filePath, Flags flags, size_t
>>> size,
>>> OwningPtr<OutputBuffer> &result);
>>>
>>>
>>> /// Returns a pointer to the start of the buffer.
>>> uint8_t *bufferStart();
>>>
>>> /// Returns a pointer to the end of the buffer.
>>> uint8_t *bufferEnd();
>>>
>>> /// Returns size of the buffer.
>>> size_t size();
>>>
>>> /// Flushes the content of the buffer to its file and deallocates t...
2012 May 08
0
[LLVMdev] [RFC] llvm/include/Support/OutputBuffer.h
...ten
> /// to the file at the specified path.
> static error_code createFile(StringRef filePath, Flags flags, size_t
> size,
> OwningPtr<OutputBuffer> &result);
>
>
> /// Returns a pointer to the start of the buffer.
> uint8_t *bufferStart();
>
> /// Returns a pointer to the end of the buffer.
> uint8_t *bufferEnd();
>
> /// Returns size of the buffer.
> size_t size();
>
> /// Flushes the content of the buffer to its file and deallocates the
> /// buffer. If commit() is not called before this o...
2012 May 08
0
[LLVMdev] [RFC] llvm/include/Support/OutputBuffer.h
...hen committed, the buffer will be written
/// to the file at the specified path.
static error_code createFile(StringRef filePath, Flags flags, size_t size,
OwningPtr<OutputBuffer> &result);
/// Returns a pointer to the start of the buffer.
uint8_t *bufferStart();
/// Returns a pointer to the end of the buffer.
uint8_t *bufferEnd();
/// Returns size of the buffer.
size_t size();
/// Flushes the content of the buffer to its file and deallocates the
/// buffer. If commit() is not called before this object's destructor
/// is called, th...
2012 May 08
1
[LLVMdev] [RFC] llvm/include/Support/OutputBuffer.h
...n
> /// to the file at the specified path.
> static error_code createFile(StringRef filePath, Flags flags, size_t size,
> OwningPtr<OutputBuffer> &result);
>
>
> /// Returns a pointer to the start of the buffer.
> uint8_t *bufferStart();
>
> /// Returns a pointer to the end of the buffer.
> uint8_t *bufferEnd();
>
> /// Returns size of the buffer.
> size_t size();
>
> /// Flushes the content of the buffer to its file and deallocates the
> /// buffer. If commit() is not called b...
2015 Apr 30
2
[LLVMdev] SmallString + raw_svector_ostream combination should be more efficient
I don't think we should make flush virtual. Why do you need to do it?
Can't you set up the base class to write to use the tail of the memory
region as the buffer?
On 24 April 2015 at 06:46, Yaron Keren <yaron.keren at gmail.com> wrote:
> Hi,
>
> Is this what you're thinking about?
> The code is not tested yet, I'd like to know if the overall direction and
>
2012 May 04
0
[LLVMdev] MemoryBuffer/raw_ostream hybrid for linker?
On May 3, 2012, at 6:10 PM, Nick Kledzik wrote:
> Existing llvm code tends to use raw_ostream for writing files. But raw_ostream is not a good match for a linker for a couple of reasons:
>
> 1) When the linker creates an executable, the file needs the 'x' bit set. Currently raw_fd_ostream has no way to set that.
If this were the only problem, I'd suggest just generalizing
2015 May 02
2
[LLVMdev] SmallString + raw_svector_ostream combination should be more efficient
Could you dig into why:
+ raw_ostream &write(unsigned char C) override {
+ grow(1);
+ *OutBufCur++ = C;
+ return *this;
+ }
Is 3 times as fast as raw_svector_ostream? I don't see a good reason why
that should be any faster than:
raw_ostream &operator<<(char C) {
if (OutBufCur >= OutBufEnd)
return write(C);
*OutBufCur++ = C;
return *this;
}
2012 May 04
2
[LLVMdev] MemoryBuffer/raw_ostream hybrid for linker?
Existing llvm code tends to use raw_ostream for writing files. But raw_ostream is not a good match for a linker for a couple of reasons:
1) When the linker creates an executable, the file needs the 'x' bit set. Currently raw_fd_ostream has no way to set that.
2) The Unix conformance suite actually has some test cases where the linker is run and the output file does exists but is not
2016 Nov 17
2
UB in MemoryBufferMMapFile
...t;>> void MemoryBuffer::init(const char *BufStart, const char *BufEnd,
>>> bool RequiresNullTerminator) {
>>> assert((!RequiresNullTerminator || BufEnd[0] == 0) &&
>>> "Buffer is not null terminated!");
>>> BufferStart = BufStart;
>>> BufferEnd = BufEnd;
>>> }
>
> Commenting from a historical perspective, this is as intended. In the
> case of an mmapped buffer, you usually mmap some file that is not a
> multiple of a page size, and the OS zero fills the rest of the page.
> This...
2015 May 02
2
[LLVMdev] SmallString + raw_svector_ostream combination should be more efficient
...&write(unsigned char C);
+ virtual raw_ostream &write(const char *Ptr, size_t Size);
// Formatted output, see the format() function in Support/Format.h.
raw_ostream &operator<<(const format_object_base &Fmt);
@@ -297,13 +299,13 @@
/// unbuffered.
const char *getBufferStart() const { return OutBufStart; }
+ /// Install the given buffer and mode.
+ void SetBufferAndMode(char *BufferStart, size_t Size, BufferKind Mode);
+
//===--------------------------------------------------------------------===//
// Private Interface
//===--------------------------------...
2008 Jan 25
0
Wine release 0.9.54
...eat the nCount variable in the EM_GETTEXTEX handler as a character count.
rpcrt4: Implement asynchronous RPC support.
rpcrt4: Move the receiving of an individual fragment to a separate function.
rpcrt4: Remove some unimplemented win9x-only spec entries.
rpcrt4: Don't set BufferStart and BufferEnd in NdrStubCall2.
ole32: Don't get the HRESULT from the buffer if we get an RPC_S_CALL_FAILED status back from the runtime.
advapi32: Add more tests for SetEntriesInAcl.
ntdll: Fix the index check in RtlGetAce.
advapi32: Implement SetEntriesInAclW.
adv...
2007 Dec 14
0
Wine release 0.9.51
...widl: Don't write redundant FC_RP type format out for conformant strings, unless it is a top level variable.
Revert "rpcrt4: Try to free every non-stack pointer in PointerFree now that NdrFree does the sanity checking for us.".
rpcrt4: NdrStubGetBuffer shouldn't set BufferStart and BufferEnd.
rpcrt4: Fix the check in NdrPointerFree.
rpcrt4: Free the base pointer in PointerFree when freeing a pointer with RPC_FC_P_DEREF.
rpcrt4: Partially revert commit 18faf3184b2ea263d77c2a7ad92eef27bc4ba08f.
rpcrt4: Document NdrAllocate.
rpcrt4: Update TODO...
2009 Mar 13
0
Wine release 1.1.17
...ole32: Get rid of WINE_StringFromCLSID and A->W conversions.
oleaut32: Make typelib.dll into a stand-alone 16-bit module.
oleaut32: Make ole2disp.dll into a stand-alone 16-bit module.
wine.inf: Fix typo in the shift_jis entry.
rpcrt4: Use RpcMsg->Buffer instead of BufferStart since the latter isn't always set.
setupapi: Check for NULL module to avoid an exception in RtlImageNtHeader.
winspool.drv: Make sure the DEVMODE structure is fully initialized.
winedbg: Don't name a function PRIVATE.
user32/tests: Add optional restore sequence for V...